The lists an address form, a language switcher or a price display needs. A site supports a subset of the platform’s languages and currencies, set in its settings, always including its default; supported asks for that subset and default for the default. The country and state lookups answer outside the API’s envelope, with options, for typeahead fields.
Languages and lookups
Languages and currencies, countries and their states, and the custom URL check.
About languages and lookups
List languages#
GET
/cdna-api/common/languages/{mode}
Lists languages: every one the platform has, or with supported the site’s.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Model
- Language, in the Reference
Parameters
modepath- string
supportedfor the site’s languages; left out, all of them.propertiesquery- selector
- The fields to return, such as
{id,code,name}.
Example
List languages
GET /cdna-api/common/languages/supported?limit=2&properties={id,code,name} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response
200 OK
{
"result": "success",
"totalCount": 1,
"data": [
{
"id": 47,
"code": "en",
"name": "English - United States"
}
]
}
Real response from this documentation site
Show a language#
GET
/cdna-api/common/language/{id}
Reads one language by its id.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Model
- Language, in the Reference
Parameters
idpathrequired- string
- The language id, or
defaultfor the site’s default. propertiesquery- selector
- The fields to return.
Example
Show a language
GET /cdna-api/common/language/default?properties={id,code,name} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response
200 OK
{
"result": "success",
"data": {
"id": 47,
"code": "en",
"name": "English - United States"
}
}
Real response from this documentation site
List currencies#
GET
/cdna-api/common/currencies/{mode}
Lists currencies: every one, or with supported the site’s.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Model
- Currency, in the Reference
Parameters
modepath- string
supportedfor the site’s currencies; left out, all of them.propertiesquery- selector
- The fields to return, such as
{id,shortName,symbol}.
Example
List currencies
GET /cdna-api/common/currencies/supported?limit=2&properties={id,shortName,symbol} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response
200 OK
{
"result": "success",
"totalCount": 1,
"data": [
{
"id": 142,
"shortName": "USD",
"symbol": "$"
}
]
}
Real response from this documentation site
Show a currency#
GET
/cdna-api/common/currency/{id}
Reads one currency by its id.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Model
- Currency, in the Reference
Parameters
idpathrequired- string
- The currency id, or
defaultfor the site’s default. propertiesquery- selector
- The fields to return.
Example
Show a currency
GET /cdna-api/common/currency/default?properties={id,shortName,symbol} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response
200 OK
{
"result": "success",
"data": {
"id": 142,
"shortName": "USD",
"symbol": "$"
}
}
Real response from this documentation site
Find countries#
GET
/cdna-api/common/countries/{term}
Countries whose name contains the term, for a typeahead. Outside the envelope: status and options, a list of names.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Model
- Country, in the Reference
Parameters
termpathrequired- string
- Part of a country’s name.
Example
Find countries
GET /cdna-api/common/countries/Aus HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response
200 OK
{
"status": "success",
"options": [
"Australia",
"Austria"
]
}
Real response from this documentation site
Find states#
GET
/cdna-api/common/country-states/{country}/{term}
A country’s states whose name contains the term, as for countries.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
Parameters
countrypathrequired- string
- The country’s name.
termpathrequired- string
- Part of a state’s name.
Example
Find states
GET /cdna-api/common/country-states/Australia/Vic HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response
200 OK
{
"status": "success",
"options": [
"Victoria"
]
}
Real response from this documentation site
Check that a custom URL is free#
POST
/cdna-api/common/check-custom-url
Answers {"result":"success"} when the path is a valid URL that no record on the site uses. A path in use answers HTTP 200 with "result": "error" and “This custom url already exists”; a malformed one with “Invalid url”.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
Parameters
pathbodyrequired- string
- The path, starting with
/. siteIdbodyrequired- integer
- The site to check in.
idbody- integer
- The custom URL record to leave out, when changing it.
Example
Check that a custom URL is free
POST /cdna-api/common/check-custom-url HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json
{
"path": "/api-sandbox-free-url",
"siteId": 66
}
Response
{
"result": "success"
}{
"result": "error",
"message": "This custom url already exists"
}
Real response from this documentation site, shortened