curl --request GET \
--url https://api.otpiq.com/api/sms/track/{smsId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.otpiq.com/api/sms/track/{smsId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.otpiq.com/api/sms/track/{smsId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.otpiq.com/api/sms/track/{smsId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.otpiq.com/api/sms/track/{smsId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.otpiq.com/api/sms/track/{smsId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.otpiq.com/api/sms/track/{smsId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"smsId": "sms-1234567890abcdef123456",
"phoneNumber": "964750123456",
"status": "sent",
"cost": 200,
"isFinalStatus": false,
"lastChannel": "whatsapp",
"channelFlow": [
{
"channel": "whatsapp",
"tried": true,
"success": true
},
{
"channel": "sms",
"tried": false
}
]
}{
"message": "Unauthorized, please use your project api key"
}{
"message": "SMS not found"
}{
"message": "Internal server error"
}Track SMS
Get the delivery status of a specific SMS message.
curl --request GET \
--url https://api.otpiq.com/api/sms/track/{smsId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.otpiq.com/api/sms/track/{smsId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.otpiq.com/api/sms/track/{smsId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.otpiq.com/api/sms/track/{smsId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.otpiq.com/api/sms/track/{smsId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.otpiq.com/api/sms/track/{smsId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.otpiq.com/api/sms/track/{smsId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"smsId": "sms-1234567890abcdef123456",
"phoneNumber": "964750123456",
"status": "sent",
"cost": 200,
"isFinalStatus": false,
"lastChannel": "whatsapp",
"channelFlow": [
{
"channel": "whatsapp",
"tried": true,
"success": true
},
{
"channel": "sms",
"tried": false
}
]
}{
"message": "Unauthorized, please use your project api key"
}{
"message": "SMS not found"
}{
"message": "Internal server error"
}Authorizations
Project API key (sk_live… or sk_dev…). Send it as Authorization: Bearer <api_key>.
Path Parameters
The SMS ID to track
^sms-[a-f0-9]{24}$"sms-1234567890abcdef123456"
Response
SMS status retrieved successfully. Response body includes SMSTrackingResponse with fields: smsId, phoneNumber, status, cost, isFinalStatus, lastChannel, channelFlow[].
Unique identifier for the SMS message
^sms-[a-f0-9]{24}$"sms-1234567890abcdef123456"
Phone number the SMS was sent to
"964750123456"
Current status of the SMS message
pending, sent, delivered, read, failed "sent"
Cost of the SMS in IQD
x >= 0200
Whether the SMS has reached a final state (no further attempts will be made)
false
The last channel attempted or used for sending. One of 'sms', 'whatsapp', 'telegram'.
Sequence of channels and their attempt statuses
Show child attributes
Show child attributes