UA API
Search
K
Links
Comment on page

Flash Call Verify API

Flash Call Verify API DecisionTelecom дозволяє надсилати Flash виклики до будь-якої країни світу через API. Номер телефону, з якого здійснюватиметься вхідний дзвінок, міститиме необхідний код для перевірки, в останніх 4-6 цифрах. Кожний виклик ідентифікується унікальним випадковим ідентифікатором.
Flash Call Verify API використовує HTTPS з ключем доступу, який використовується як авторизація API. Корисні дані запитів та відповідей форматуються як JSON за допомогою кодування UTF-8 та значень у кодуванні URL.
API Авторизація - Базовий ключ доступу Base64.
Щоб отримати ключ API, будь ласка, зв'яжіться з вашим менеджером по роботі з клієнтами.

Надіслати flash call verification

Auth: Basic Auth (api key)
Method Post
https://web.it-decision.com/v1/api/flash-call
Params json:
{
"phone":380631111111,
"sender":"Decision",
"text":1233,
"validity_period":2
}
phone int The telephone number that you want to do a network query on
sender string The sender of the message. This can be a mobile phone number (including a country code) or an alphanumeric string. The maximum length of alphanumeric strings is 11 characters.
validity_period int SMS lifetime min 2 minute max 4320
Text string Text consists only short code with 4-6 numbers
Response: Returns json string if the request was successful.
{
"id": 26381905,
"phone": 380631111111,
"status": "Accepted"
}
Id int - A unique random ID which is created on the DecisionTelecom platform.
status string – the status of the phone. Possible values: accepted, rejected, unknown, and failed

Example code :

CURL
GO
C#
Java
C – libcurl
PHP
Python
curl --location 'https//:web.it-decision.com/v1/api/flash-call' \
--header 'Authorization: Basic api key' \
--header 'Content-Type: application/json' \
--data '{"phone":380631111111,"sender":"Decision","text":1233,"validity_period":2}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https//:web.it-decision.com/v1/api/flash-call"
method := "POST"
payload := strings.NewReader(`{"phone":380631111111,"sender":"Decision","text":1233,"validity_period":2}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Basic api key")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https//:web.it-decision.com/v1/api/flash-call");
request.Headers.Add("Authorization", "Basic api key");
var content = new StringContent("{\"phone\":380631111111,\"sender\":\"Decision\",\"text\":1233,\"validity_period\":2}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"phone\":380631111111,\"sender\":\"Decision\",\"text\":1233,\"validity_period\":2}");
Request request = new Request.Builder()
.url("https//:web.it-decision.com/v1/api/flash-call")
.method("POST", body)
.addHeader("Authorization", "Basic api key")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "https//:web.it-decision.com/v1/api/flash-call");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Basic api key");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "{\"phone\":380631111111,\"sender\":\"Decision\",\"text\":1233,\"validity_period\":2}";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https//:web.it-decision.com/v1/api/flash-call',
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 =>'{"phone":380631111111,"sender":"Decision","text":1233,"validity_period":2}',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic api key',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import http.client
import json
conn = http.client.HTTPSConnection("https")
payload = json.dumps({
"phone": 380631111111,
"sender": "Decision",
"text": 1233,
"validity_period": 2
})
headers = {
'Authorization': 'Basic api key',
'Content-Type': 'application/json'
}
conn.request("POST", "//:web.it-decision.com/v1/api/flash-call", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))