REST API Integration

 

This endpoint is used to send SMS, using the API Key. the key sent in the header (Authorization : Basic [API Key])

request url : https://api.textit.biz/

 

Sample request headers

Content-Type: application/json
Accept: */*
X-API-VERSION: v1
Authorization: Basic eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJzdXBlckBteWxpbm

 

Sample request body

{
"to": "94772823050",
"text": "Test"
}
 

 

Advanced Parameters

Parameter Expected Value(s) Notes
to Recipient Phone Number Required | All Packages

Local Numbers : Any format supported eg. 07XXX... , 7XXX, 947XXX...

International : 00<country code><area code><phone number> eg. 0091987654321

text Message Content Required | All Packages
ref

Alpha-numeric

(upto 15 characters)

Optional

Passthrough Variable, only shows in reports

eg. ref=NewCampaign

schd  YYYY‐MM‐ DD_HH:MM  Or  YYYYMMDDHHMM Optional 

Schedule Send Date / Time. Textit.biz will store the message in servers and process at the given time. 

Formats : YYYY‐MM‐ DD_HH:MM  Or  YYYYMMDDHHMM

Eg.  schd=2021‐01‐31_23:59  or  schd=202101312359 

for more in-depth integration instructions, download our REST API Integration Guide


 

 

PHP cURL Example Script

 

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.textit.biz',
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 =>'{
"to": "94772823050",
"text": "Test"
}

',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Accept: */*',
'X-API-VERSION: v1',
'Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxx'
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;