Get countries and their corresponding phone constraints.
curl --request GET \
--url https://{apiBaseUrl}/v2/{sessionId}/resources/countriesconst url = 'https://{apiBaseUrl}/v2/{sessionId}/resources/countries';
const options = {method: 'GET'};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://{apiBaseUrl}/v2/{sessionId}/resources/countries"
response = requests.get(url)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{apiBaseUrl}/v2/{sessionId}/resources/countries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}using RestSharp;
var options = new RestClientOptions("https://{apiBaseUrl}/v2/{sessionId}/resources/countries");
var client = new RestClient(options);
var request = new RestRequest("");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.get("https://{apiBaseUrl}/v2/{sessionId}/resources/countries")
.asString();{
"countries": [
{
"isoAlpha2": "FR",
"name": "France",
"phoneContraint": {
"isStrict": true,
"cellPhoneRegex": "^0?(6|7)\\d{8}$",
"nationalPrefix": "0",
"internationalPrefix": "+33"
}
},
{
"isoAlpha2": "GQ",
"name": "Equatorial Guinea",
"phoneContraint": {
"isStrict": false,
"internationalPrefix": "+240"
}
},
{
"isoAlpha2": "CZ",
"name": "Czech Republic",
"phoneContraint": {
"isStrict": false,
"internationalPrefix": "+420"
}
}
]
}{
"code": "InvalidSessionId"
}{
"code": "InvalidUserAuthentication",
"message": "<string>"
}Resources
Get countries and their corresponding phone constraints
Get countries and their corresponding phone constraints
GET
/
v2
/
{sessionId}
/
resources
/
countries
Get countries and their corresponding phone constraints.
curl --request GET \
--url https://{apiBaseUrl}/v2/{sessionId}/resources/countriesconst url = 'https://{apiBaseUrl}/v2/{sessionId}/resources/countries';
const options = {method: 'GET'};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://{apiBaseUrl}/v2/{sessionId}/resources/countries"
response = requests.get(url)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{apiBaseUrl}/v2/{sessionId}/resources/countries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}using RestSharp;
var options = new RestClientOptions("https://{apiBaseUrl}/v2/{sessionId}/resources/countries");
var client = new RestClient(options);
var request = new RestRequest("");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.get("https://{apiBaseUrl}/v2/{sessionId}/resources/countries")
.asString();{
"countries": [
{
"isoAlpha2": "FR",
"name": "France",
"phoneContraint": {
"isStrict": true,
"cellPhoneRegex": "^0?(6|7)\\d{8}$",
"nationalPrefix": "0",
"internationalPrefix": "+33"
}
},
{
"isoAlpha2": "GQ",
"name": "Equatorial Guinea",
"phoneContraint": {
"isStrict": false,
"internationalPrefix": "+240"
}
},
{
"isoAlpha2": "CZ",
"name": "Czech Republic",
"phoneContraint": {
"isStrict": false,
"internationalPrefix": "+420"
}
}
]
}{
"code": "InvalidSessionId"
}{
"code": "InvalidUserAuthentication",
"message": "<string>"
}Was this page helpful?