Flash Call - API
Welcome to the future of seamless verification! Betatel’s Flash Call API empowers developers to integrate swift and secure phone number verification directly into their applications. Whether you're building a high-traffic login system or ensuring user authenticity for sensitive transactions, this API guarantees a smooth, reliable experience.
Endpoint
It all begins with the endpoint—a gateway to delivering trust.
https://api.betatel.com/api/v1/callgen/call/flash
Method: POST
This endpoint generates a flash call for verifying phone numbers by triggering a call with a unique caller ID.
Headers
Your ticket to authentication starts with the headers. Properly set headers are essential to ensure your request is authorized and understood.
Param | Value | Description |
---|---|---|
Content-type | application/json | Specifies the format of your payload. |
x-api-key | {{x-api-key}} | Your unique API key for secure access. |
x-user-id | {{x-user-id}} | Your user identifier for added security and tracking. |
Request Body
The payload is the heart of your request. Here’s where you define the essence of the flash call.
{
"callType":"flash",
"callee":"38764444405",
"caller":"555345",
"maxRingTime": 5
}
Field | Type | Required | Description |
---|---|---|---|
callType | string | Yes | Set as "flash" to specify this call type. |
callee | string | Yes | The recipient’s phone number in international format. |
caller | string | Yes | The verification code to send (visible as the caller ID during the flash call). |
maxRingTime | integer | No | Maximum duration for the call to ring, in seconds (default: 5). |
Code Snippets
- cUrl
- Python
- Node.js
- PHP
- Java
- C#
curl --location 'https://dev.api.betatel.com/api/v1/callgen/call/flash' \
--header 'x-user-id: 675aed6103dee9ca55a36a9a' \
--header 'Content-Type: application/json' \
--header 'x-api-key: ••••••' \
--data '{
"callType":"flash",
"callee":"38764444405",
"caller":"555345",
"maxRingTime": 5
}'
import http.client
import json
conn = http.client.HTTPSConnection("dev.api.betatel.com")
payload = json.dumps({
"callType": "flash",
"callee": "38764444405",
"caller": "555345",
"maxRingTime": 5
})
headers = {
'x-user-id': '675aed6103dee9ca55a36a9a',
'Content-Type': 'application/json',
'x-api-key': '••••••'
}
conn.request("POST", "/api/v1/callgen/call/flash", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const axios = require('axios');
let data = JSON.stringify({
"callType": "flash",
"callee": "38764444405",
"caller": "555345",
"maxRingTime": 5
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://dev.api.betatel.com/api/v1/callgen/call/flash',
headers: {
'x-user-id': '675aed6103dee9ca55a36a9a',
'Content-Type': 'application/json',
'x-api-key': '••••••'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://dev.api.betatel.com/api/v1/callgen/call/flash',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"callType":"flash",
"callee":"38764444405",
"caller":"555345",
"maxRingTime": 5
}',
CURLOPT_HTTPHEADER => array(
'x-user-id: 675aed6103dee9ca55a36a9a',
'Content-Type: application/json',
'x-api-key: ••••••'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://dev.api.betatel.com/api/v1/callgen/call/flash")
.header("x-user-id", "675aed6103dee9ca55a36a9a")
.header("Content-Type", "application/json")
.header("x-api-key", "••••••")
.body("{\n \"callType\":\"flash\",\n \"callee\":\"38764444405\",\n \"caller\":\"555345\",\n \"maxRingTime\": 5\n}")
.asString();
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://dev.api.betatel.com/api/v1/callgen/call/flash");
request.Headers.Add("x-user-id", "675aed6103dee9ca55a36a9a");
request.Headers.Add("x-api-key", "••••••");
var content = new StringContent("{\n \"callType\":\"flash\",\n \"callee\":\"38764444405\",\n \"caller\":\"555345\",\n \"maxRingTime\": 5\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
Every journey ends with confirmation. Here’s what the API will return once your request is processed:
JSON Schema:
{
"uuid": "string"
}
uuid
: A unique identifier to track the call and verify its status.
Congratulations
You're now equipped to implement the Flash Call API for secure and swift phone number verification. By leveraging the power of flash calls, you can deliver a seamless experience for your users, ensuring their numbers are verified in seconds.