# Get Countries Info
This service is used to get a list of country code and names.
# Request Configuration
# Request Endpoint
/api/Activation/GetCountries
# Request Method
GET
# Request Headers
Name | Type | Description |
---|---|---|
client | string | Use bID returned from Login |
apitoken | string | Use Token returned from Login |
# Request Parameters:
None
# Request Body
None
# Sample Reqeust
# Sample Request URL
https://phoneboxapi.azurewebsites.net/api/Activation/GetCountries
# cURL
curl --location --request GET 'https://phoneboxapi.azurewebsites.net/api/Activation/GetCountries' \
--header 'client: 1234' \
--header 'apitoken: foqxcFJ82EhecRXnIZbeQbb8m9/dFFHO'
# Python - Requests
import requests
url = "https://phoneboxapi.azurewebsites.net/api/Activation/GetCountries"
params = {
}
headers = {
'client': '1234',
'apitoken': 'foqxcFJ82EhecRXnIZbeQbb8m9/dFFHO'
}
response = requests.get(url, headers=headers, params=params)
print(response.text.encode('utf8'))
# NodeJs -Axios
var axios = require('axios');
var data = {};
const url = "https://phoneboxapi.azurewebsites.net/api/Activation/GetCountries";
axios
.get(
url,
{
headers: {
client: '1234',
apitoken: 'foqxcFJ82EhecRXnIZbeQbb8m9'
}
}
)
.then(res => {
console.log(JSON.parse(res.data));
})
.catch(err => {
console.log(err);
});
# Response
# Success
return a list of JSON containing below information
[
{
"CountryCode": "4",
"CountryName": "Afghanistan",
"CountryCodeISO": "AF"
},
{
"CountryCode": "17",
"CountryName": "Åland and Islands",
"CountryCodeISO": "AX"
},
{
"CountryCode": "7",
"CountryName": "Albania",
"CountryCodeISO": "AL"
},
{
"CountryCode": "5",
"CountryName": "Algeria",
"CountryCodeISO": "DZ"
},
......
]
# Fail
Failed Authorization
reason: wrong login credential
{
"Message": "Authorization has been denied for this request."
}