Listing countries - /countries API

https://api.digitalmbridge.com/v2/countries/ API responds to the following request methods:

API endpoint HTTP Method API description
/countries/ GET show all countries
/countries/id/<country_id> GET show country matching path variable <country_id>


Every unsuccessful request made to /countries API will return a HTTP status 400 and a json response as follows:

{
  "status": "error",
  "message": "<error-message>"
}


GET
 request to https://api.digitalmbridge.com/v2/countries/ will return all countries where Digital Media Bridge is able to send sms messages.

In the event of a successful request, Digital Media Bridge will return a json response as follows:

{
  "status": "success",
  "countries": [
    <country_1>,
    <country_2>,
    ...
  ]
}


GET request to https://api.digitalmbridge.com/v2/countries/id/<country_id> will return country information matching <country_id> path variable.

In the event of a successful request, Digital Media Bridge will return a json response as follows:

{
  "status": "success",
  "country": <country>
}


Response example:

{
  "status": "success",
  "country": {
    "id": 10,
    "prefix": "+39",
    "country": "Italy"
  }
}

Article Details

Article ID:
12

Related articles