Get regulatory requirements
Get the regulatory information needed to buy a phone number, for one specific number or for a country and number type. Prefer phoneNumber: the response is then exactly the list the purchase of that number validates against. Pass each requirementTypes[].id back as requirementType in regulatoryRequirements on POST /v1/phone-numbers.
For phoneNumber, the requirements of that exact number are returned. When they cannot be resolved for the number itself, the list for its country and type is returned instead, and the purchase uses the same list. An empty items array means the number needs no regulatory information. If the requirements cannot be retrieved at all, the response is 502 requirements_unavailable, never an empty list.
URL-encode the + of phoneNumber as %2B. An unencoded + is also accepted.
curl --request GET \
--url https://api.zavu.dev/v1/phone-numbers/requirements \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zavu.dev/v1/phone-numbers/requirements"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zavu.dev/v1/phone-numbers/requirements', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zavu.dev/v1/phone-numbers/requirements",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zavu.dev/v1/phone-numbers/requirements"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.zavu.dev/v1/phone-numbers/requirements")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v1/phone-numbers/requirements")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "+4930123456",
"countryCode": "DE",
"phoneNumberType": "local",
"action": "ordering",
"requirementTypes": [
{
"id": "8c5b1a2e-0f3d-4f5b-9a61-2c7e4d9b1f10",
"name": "Address",
"description": "An address in Germany",
"type": "address"
},
{
"id": "3f9e2d41-7b6a-4c1e-8d52-9a0b1c2d3e4f",
"name": "Identity document",
"description": "A copy of an identity document",
"type": "document"
}
]
}
]
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "requirements_unavailable",
"message": "Regulatory requirements could not be retrieved right now. Retry shortly; do not treat this as no requirements."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Two-letter ISO country code. Required unless phoneNumber is given.
2Type of phone number (local, national, mobile, tollFree). Defaults to local. With phoneNumber, used only when the number's own requirements cannot be resolved and the country list is returned.
Type of phone number. mobile is stocked in countries where no geographic (local) or non-geographic (national) inventory exists, and in several markets it is the only type that can receive SMS.
local, national, tollFree, mobile E.164 number from GET /v1/phone-numbers/available, with + encoded as %2B. Returns the requirements the purchase of that number checks. Takes precedence over countryCode.
Response
Requirements for the number, or for the country and type.
Show child attributes
Show child attributes
curl --request GET \
--url https://api.zavu.dev/v1/phone-numbers/requirements \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zavu.dev/v1/phone-numbers/requirements"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zavu.dev/v1/phone-numbers/requirements', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zavu.dev/v1/phone-numbers/requirements",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zavu.dev/v1/phone-numbers/requirements"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.zavu.dev/v1/phone-numbers/requirements")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v1/phone-numbers/requirements")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "+4930123456",
"countryCode": "DE",
"phoneNumberType": "local",
"action": "ordering",
"requirementTypes": [
{
"id": "8c5b1a2e-0f3d-4f5b-9a61-2c7e4d9b1f10",
"name": "Address",
"description": "An address in Germany",
"type": "address"
},
{
"id": "3f9e2d41-7b6a-4c1e-8d52-9a0b1c2d3e4f",
"name": "Identity document",
"description": "A copy of an identity document",
"type": "document"
}
]
}
]
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "requirements_unavailable",
"message": "Regulatory requirements could not be retrieved right now. Retry shortly; do not treat this as no requirements."
}