This API call returns a list of all available countries and their associated IDs. You can use these for other calls in our API so that you can request data only for a specific region from your subscription. Filtering data by countries allows you to offer relevant content for your members and to target regional markets.
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); } ?>