
If you're looking to integrate a robust SMS API, enhance your messaging capabilities, or perform network validations through HLR lookup, then Ankarex provides comprehensive solutions that fit your needs. This tutorial will walk you through the process step-by-step, ensuring you master the tools offered by Ankarex Platform
Step 1: Generate Your API Key
Firstly, you need to obtain an API key to authenticate your requests. Log in to app.ankarex.io and navigate to the Developers section. Generate a new API key. Your API key will look similar to this:
Y6BL-HGA9-8XSK-DSK9-AH2A-GLA9-6WH3-WQPB
Endpoint and User-Agent
Always use the endpoint below for all requests:
https://app.ankarex.io/api/json
Ensure your requests include the following User-Agent:
Ankarex-Rest-0.22
API Request Examples
Below are examples demonstrating basic functionalities. These codes are illustrative and for demonstration only.
Get Account Status
Use this to retrieve your account balance and connection status:
{
"token": "YBCU-EMHR-WLDH-U6L8-LWNU-WW5A-7XJL-X2E7",
"status": "account"
}
Response:
{
"balance": 673.28,
"info": "CONNECTED_API"
}
Send SMS
Send SMS to single or multiple recipients:
{
"token": "YBCU-EMHR-WLDH-U6L8-LWNU-WW5A-7XJL-X2E7",
"send": "bulk",
"to": "123456789",
"sender_id": "SMS",
"message_content": "Hi Hi! \n New Line",
"unicode": false
// "option": "59e40e315331dcba6cb4dd149dd3d8d2" (Optional - for custom routes)
}
Response:
{
"info": "SENT",
"campaign_id": 14311
}
Get Delivery Report (DLR)
Track your SMS delivery status:
{
"token": "YBCU-EMHR-WLDH-U6L8-LWNU-WW5A-7XJL-X2E7",
"send": "dlr",
"id": "1759619"
}
Response:
{
"status": 0,
"array": [
[
1061824,
"123456789",
20241122141213,
0,
20241122141229,
3
]
],
"success": 1,
"fail": 0,
"unsent": 0,
"sending": 0,
"nofound": 0,
"deliverSuc": 1,
"deliverFail": 0,
"deliverTimeout": 0
}
Get Coverage & Prices
Obtain SMS route pricing and coverage:
{
"token": "YBCU-EMHR-WLDH-U6L8-LWNU-WW5A-7XJL-X2E7",
"send": "prices"
}
Sample Response:
{
"data": [
{"name": "Spain", "prefix": "34", "price": 0.05, "type": "OPEN SID"},
{"name": "Italy", "prefix": "39", "price": 0.05, "type": "OPEN SID"},
{"name": "Chile", "prefix": "56", "price": 0.022, "type": "LLC"}
// any other countries available will be shown here.
]
}
Get Route Options
Check available routing options per country:
{
"token": "YBCU-EMHR-WLDH-U6L8-LWNU-WW5A-7XJL-X2E7",
"send": "getoptions"
}
Response:
{
"options": {
"FRANCE": [
{
"option_id": "59e40e315331dcba6cb4dd149dd3d8d2",
"name": "France Custom",
"price": 0.05,
"prefix": "33",
"is_custom": true
}
]
// any other countries available will be shown here.
}
}

Download Python Examples :
Download PHP Examples:
Frequently Asked Questions
What is the maximum message length?
Standard SMS: 160 characters. With Unicode (unicode: true): 130 characters per segment.
How do I handle multiple recipients?
Provide numbers comma-separated, e.g., "to": "34123456789,34987654321"
. Campaigns auto-split after 500 recipients.
What are the Sender ID requirements?
- Max 11 alphanumeric characters
- Pre-registration required for some countries
- Subject to carrier restrictions
How do I track message delivery?
Use the DLR endpoint with your campaign_id. Statuses include:
success
: Delivered
fail
: Not delivered
sending
: In transit
unsent
: Pending processing
How do custom routes work?
- Country-specific routes
- Only numbers from specified countries allowed
- Numbers outside these routes are auto-removed
- Include
option_id
to use specific custom routes