countries
Creates, updates, deletes, gets or lists a countries resource.
Overview
| Name | countries |
| Type | Resource |
| Id | godaddy.countries.countries |
Fields
The following fields are returned by SELECT queries:
- get_country
- get_countries
Request was successful
| Name | Datatype | Description |
|---|---|---|
callingCode | string | The calling code prefix used for phone numbers in this country |
countryKey | string (iso-country-code) | The ISO country-code |
label | string | The localized name of the country |
states | array | List of states/provinces in this country |
Request was successful
| Name | Datatype | Description |
|---|---|---|
callingCode | string | The calling code prefix used for phone numbers in this country |
countryKey | string (iso-country-code) | The ISO country-code |
label | string | The localized name of the country |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_country | select | country_key, marketId | sort, order | Retrieves country and summary state information for provided countryKey. Authorization is not required. |
get_countries | select | marketId | regionTypeId, regionName, sort, order | Retrieves summary country information for the provided marketId and filters. Authorization is not required. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
country_key | string (iso-country-code) | The country key |
marketId | string (bcp-47) | MarketId in which the request is being made, and for which responses should be localized |
order | string | The direction to sort the result countries by. |
regionName | string | Restrict countries to this region name; required if regionTypeId is supplied |
regionTypeId | integer | Restrict countries to this region type; required if regionName is supplied |
sort | string | The term to sort the result countries by. |
SELECT examples
- get_country
- get_countries
Retrieves country and summary state information for provided countryKey. Authorization is not required.
SELECT
callingCode,
countryKey,
label,
states
FROM godaddy.countries.countries
WHERE country_key = '{{ country_key }}' -- required
AND marketId = '{{ marketId }}' -- required
AND sort = '{{ sort }}'
AND order = '{{ order }}'
;
Retrieves summary country information for the provided marketId and filters. Authorization is not required.
SELECT
callingCode,
countryKey,
label
FROM godaddy.countries.countries
WHERE marketId = '{{ marketId }}' -- required
AND regionTypeId = '{{ regionTypeId }}'
AND regionName = '{{ regionName }}'
AND sort = '{{ sort }}'
AND order = '{{ order }}'
;