API reference / v2.2 / Credentials
API credentials.
Every VoiceTel account is provisioned with a single API key that authorizes every v2.2 REST endpoint. Retrieve it from the portal, then attach it to every request using the Authorization header. Unlike v2.1, the v2.2 API does not accept the key in the JSON request body.
Authentication
v2.2 supports a single authentication scheme: an RFC 6750 bearer token in the Authorization header.
curl -X GET 'https://api.voicetel.com/v2.2/cnam/2015551234' \
-H 'Authorization: Bearer YOUR_API_KEY'
For requests with a JSON body, set Content-Type: application/json as usual; the key still travels in the header.
curl -X PUT 'https://api.voicetel.com/v2.2/numbers/+12015551234/forward' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{ "destination": "+19735551234" }'
Retrieve via API
The portal is the simplest path, but you can also retrieve the key programmatically by POSTing your account credentials to /v2.2/account/api-key. This is the only v2.2 endpoint that accepts username and password in the request body; every other request uses the resulting bearer token.
Request
POST https://api.voicetel.com/v2.2/account/api-key
Content-Type: application/json
{
"username": 1234567890,
"password": "your-account-password"
}
Response
200 OK
Content-Type: application/json
{
"status": "success",
"data": {
"apikey": "abc123abc123abc123abc123abc123ab"
}
}
Try it
Submit your account credentials below. The request runs from this browser straight to api.voicetel.com; nothing passes through the VoiceTel website backend. The password field is cleared on success.