Home

PHP

Categories

If you would like to get a list of categories used on our platform for organizing the advertisers you can use the following to search or browse through all available categories in our catalog. Using this search from our API you will get the ID of the category, its name and also the parent ID if a specific category is included under a bigger category. You can choose to work only with merchants from a certain category or exclude categories that are not of interest for your business.

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);
}
?>