Home

PHP

Categories

If you would like to get a list of categories can use the following to search or browse through all available categories in our catalog.

API Function: get_categories

Parameters:

Name Type Description
username string Your API username. You should have received this with your account
subscription_id string Your Subscription ID. You can copy or regenerate it from your API management interface.

 

Response fields:

Name Type Description
category_id numeric The unique ID associated with the category
parent_id numeric The ID of the parent category (if exists)
category_name string The name of the category


              
              
              
              
<?php   
$api_username             = '*******';
$api_subscription         = '*******';

try
{
        $client      = new SoapClient('https://synced.io/api/v2?wsdl');
        $categories  = $client->get_categories($api_username, $api_subscription);			
}
catch(Exception $e)
{
        echo $e->getMessage();
}    


if(!empty($categories))
{
    print_r($categories);
}
?>