/countries [GET]

Return list of country information.

The list may be simply alphabetical or it may include one or more “featured countries” at the top - these are common country selections for a given site and should be offered first, as well as in the main body of the list, e.g.,

Greece United Kingdom United States


Åland Islands … Greece … United Kingdom United States … Zimbabwe

Parameters

  • siteid (numeric) [REQUIRED if called without an Authorization header] - a valid site ID
  • locale (string) [optional] - if called without an Authorization header, specifies the locale to use instead of the site’s default; if called with an Authorization header, the member’s preferred locale is used and the locale argument is ignored
  • platform (string) [optional] - one of "app_android", "app_ios", or "web"; identifies the host platform for the client application which may be used in logging internally to help us understand behavior across platforms.

If this API is called without an Authorization header, then siteid must be provided as it used to determine whether there are any “featured countries”. If this API is called with an Authorization header then the user is known and we can deduce the site ID for you (or you can still pass it to override the currently authorized user’s site).

Response Messages

403 Forbidden - if siteid is omitted on an unauthenticated call

{ "fail" : "Invalid Argument" }

200 OK - success

{
  "countries" : [

In the array of countries, there are three fields for each country:

  • featurecountry - a flag indicating that this country is part of the initial “featured countries” list,
  • country - the full name of the country, localized for the current member or the site default locale,
  • code - the 2-letter ISO code for the country (to be used in API calls).
    { "featurecountry" : "y", // or "n"
      "country" : "États-Unis",
      "code" : "US" },
    { "featurecountry" : "n",
      "country" : "Autriche",
      "code" : "AT" },
    ...
  ]
}

The countries you should “feature” are also repeated in the alphabetical non-featured list: bear this in mind if you are highlighting the member’s current country in a selection list as you should highlight the first match. It is expected that you will display some sort of dividor between the countries you “feature” and the main alphabetical list.