Get Countries

Description

Returns a list of countries. Pagination is disabled.

Request

HTTP Method: GET

URI Path: /v3/countries

URI Query Parameters:

Name

Type

Is Required?

Description

filter[<filter_name>]

string

Optional

Filtering

sort

string

Optional

Sorting

Filters:

Filter Name

Type

Allow Blank

Allow Array

Filters by:

id

string

No

Yes

Country id field.

name

string

Yes

Yes

Country name field.

prefix

string

Yes

Yes

Country prefix field.

iso

string

Yes

Yes

Country iso field.

is_available

boolean

No

No

When true, shows countries which have DID groups in coverage with DID numbers available for purchase. When false shows countries which have DID groups without DID numbers available for purchase.

Sorting:

Value

Sorts by:

name

Country name field

prefix

Country prefix field

iso

Country iso field

Example

http

GET /v3/countries HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

curl

curl -i https://api.didww.com/v3/countries -H 'Accept: application/vnd.api+json' -H 'Api-Key: [API token]' -H 'Content-Type: application/vnd.api+json'

response

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
     "data": [
         {
             "id": "9c56fe0f-eff0-4742-85f6-24868959344a",
             "type": "countries",
             "attributes": {
                 "name": "United Kingdom",
                 "prefix": "44",
                 "iso": "GB"
             },
             "relationships": {
                 "regions": {
                     "links": {
                         "self": "https://api.didww.com/v3/countries/9c56fe0f-eff0-4742-85f6-24868959344a/relationships/regions",
                         "related": "https://api.didww.com/v3/countries/9c56fe0f-eff0-4742-85f6-24868959344a/regions"
                     }
                 }
             }
         },
         {
             "id": "5d3d7640-16d2-4dc0-9aca-408789fbefc6",
             "type": "countries",
             "attributes": {
                 "name": "United States",
                 "prefix": "1",
                 "iso": "US"
             },
             "relationships": {
                 "regions": {
                     "links": {
                         "self": "https://api.didww.com/v3/countries/5d3d7640-16d2-4dc0-9aca-408789fbefc6/relationships/regions",
                         "related": "https://api.didww.com/v3/countries/5d3d7640-16d2-4dc0-9aca-408789fbefc6/regions"
                     }
                 }
             }
         }
     ],
     "meta": {
         "api_version": "2017-09-18"
     }
 }

Other Responses

Code

Success

Description

401

No

Unauthorized