List DID Types
List all available DID (Direct Inward Dialing) number types. These types are used when searching for number groups.
Endpoint
GET https://api.p.2chat.io/open/numbers/did-types
Authentication
Include your API key in the X-User-API-Key header. Learn more about authentication.
Parameters
No parameters required.
Invocation
- cURL
- Python
- JavaScript
- PHP
curl --location --request GET 'https://api.p.2chat.io/open/numbers/did-types' \
--header 'X-User-API-Key: your_api_key_here'
import requests
url = "https://api.p.2chat.io/open/numbers/did-types"
headers = {
"X-User-API-Key": "your_api_key_here"
}
response = requests.get(url, headers=headers)
print(response.json())
const axios = require('axios');
const response = await axios.get('https://api.p.2chat.io/open/numbers/did-types', {
headers: {
'X-User-API-Key': 'your_api_key_here'
}
});
console.log(response.data);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.p.2chat.io/open/numbers/did-types',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'X-User-API-Key: your_api_key_here'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response
Success
{
"success": true,
"data": {
"did_types": [
{
"id": 1,
"name": "local"
}
]
}
}
| Field | Description |
|---|---|
did_types[].id | DID type ID |
did_types[].name | DID type name |
Known DID types
| Name | Description |
|---|---|
global | International numbers accessible from multiple countries |
local | Local numbers tied to a specific city or region |
mobile | Mobile phone numbers |
national | National numbers accessible from anywhere in the country |
sharedcost | Shared-cost numbers where the call charge is split |
tollfree | Toll-free numbers where the receiver pays for the call |
Error
{
"success": false,
"error": true,
"error_message": "Description of what went wrong"
}