Home

PHP

Countries

This API call returns a list of all available countries. You can use this data to filter the data returned by the offers call.

API Function: get_countries

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: a list of countries, each having these fields:

Name Type Description
country_id numeric The unique ID associated with the country
country_name string The name of the country


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

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


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