RU API
  • Описание DecisionTelecom API
  • SMS API
  • VIBER API
  • WhatsApp Business API
  • RCS API
  • Verify API
  • Flash Call Verify API
  • VIBER + SMS API
  • HLR API
  • Voice API
Powered by GitBook
On this page
  • Отправить flash call verification
  • Example code :

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)

https://web.it-decision.com/v1/api/flash-call
{
   "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 --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"))
PreviousVerify APINextVIBER + SMS API

Last updated 1 year ago