Home

PHP

Subcategories

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

API Function: get_subcategories

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.
language_id numeric Unique ID of the language for you want to get subcategories

 

Response fields:

Name Type Description
subcategory_id numeric The unique ID associated with the subcategory
category_id numeric The unique ID of the parent category
subcategory_name string The name of the subcategory
category_name string The name of the parent category

 

              
              
              
              
<?php   
$api_username             = '*******';
$api_subscription         = '*******';
$api_language_id          = 0; // return subcategories for this language if is set

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


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