Skip to main content

Get started with three simple steps

This guide will walk you through authentication and making your first API call.

Step 1: Obtain API Credentials

Contact your Telegent representative to receive your API credentials:
  • AccountKey (e.g., DID-1e24785ab-3f3c-7db1-89d7-956d80fdnn2)
  • AccountSecret (e.g., cfmtvVERgKcdqKZZTwIjF4S1)
Keep your credentials secure. Never expose them in client-side code or public repositories.

Step 2: Authenticate and Get Token

Make a POST request to the authentication endpoint:
curl --request POST \
  --url https://api.telegent.com/v1.1/oauth/token \
  --header 'Content-Type: application/json' \
  --data '{
    "AccountKey": "YOUR_ACCOUNT_KEY",
    "AccountSecret": "YOUR_ACCOUNT_SECRET",
    "ApiEndpoint": "https://api.telegent.com"
  }'
Response:
{
  "Token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "Successful": true,
  "TokenExpiry": "2025-12-31T23:59:59Z",
  "ApiEndpoint": "https://api.telegent.com"
}
Save the Token value - you’ll need it for all subsequent API requests.

Step 3: Make Your First API Call

Use your token to search for available phone numbers:
curl --request POST \
  --url https://api.telegent.com/v1.0/numbers/availability \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "NumberType": "mobile",
    "MessageEnabled": true,
    "VoiceEnabled": true,
    "AreaCode": "801",
    "TotalNumbersRequested": 10
  }'
Response:
{
  "Successful": true,
  "PageNumber": 1,
  "TotalNumbersRequested": 10,
  "Numbers": [
    "+18015550101",
    "+18015550102",
    "+18015550103"
  ]
}
Congratulations! You’ve successfully authenticated and made your first API call.

Next Steps

Explore these key API capabilities:

Key Concepts

All phone numbers use E.164 format: +<country_code><number>Examples:
  • US: +18015551234
  • UK: +442071234567
  • A2P (Application-to-Person): Business messaging to consumers
  • P2P (Person-to-Person): Individual messaging
  • MVNO: Mobile virtual network operator numbers
  • IoT: Internet of Things capable numbers
  • VoIP: Voice over IP numbers
  • Tokens expire after the time specified in TokenExpiry
  • Request a new token when expired
  • Use the same credentials for re-authentication

Need Help?