Overview and parameters
HTTP based API will be used in sending SMS through TeleOSS.
Parameters Detail:
| Parameter | Value (Sample) | Required | Description |
|---|---|---|---|
| apikey | 54XXXXXXXXXXXXX | Mandatory | Assigned API key of user. This key user can get from portal by logging into the system. |
| mobiles | 8745xx6587,8401xx0248,8866xx9944 | Mandatory | Comma separated mobile numbers on which message will be delivered. |
| sms | Test SMS from API | Mandatory | Message content. |
| senderid | aXXXXXX | Optional | Sender ID of user. If you do not enter any specific sender ID, then it will take default sender ID assigned to user account. |
| schedule | no/yes | Optional | If you want to schedule messages then set this parameter value to yes. By default its no. |
| sending-time | Sending time | Optional | If message needs to be sent to particular recipient in future, then Date & Time can be scheduled for particular message. Format for date & time is configurable. |
| unicode | yes/no | Optional | If you want to send Unicode SMS, then enter value as yes. If you do not provide value, then system will take no as non-Unicode by default. |
| client-sms-ids | Third party id | Optional | If client wants to receive the same ID in response, he can set ID in this parameter. There will be one ID for one message. |
| message-type | Message Type | Optional | Message Type. Default is decided by system. Possible values: SMS, flash. |
Error Codes -
| Sr No | Error Code | Error Status |
|---|---|---|
| 1 | -101 | Unknown |
| 2 | 000 | Success |
| 3 | 001 | Required |
| 4 | 002 | Invalid |
| 5 | 003 | Failed |
| 6 | 004 | Duplicate |
Request reference
Request
Code examples
Code example
curl --location --request GET 'https://{Domain}/client/api/sendmessage?apikey={apikey}&mobiles={mobileno}&sms={message}&senderid={senderid}&schedule={schedule}&sending-time={dd-MM-yyyy HH:mm:ss}& client-sms-ids={id}&unicode={yes}&message-type={messageType}'const url = "https://{Domain}/client/api/sendmessage?apikey={apikey}&mobiles={mobileno}&sms={message}&senderid={senderid}&schedule={schedule}&sending-time={dd-MM-yyyy HH:mm:ss}& client-sms-ids={id}&unicode={yes}&message-type={messageType}";
const options = {
method: "GET"
};
const response = await fetch(url, options);
const data = await response.json();
console.log(data);import requests
url = "https://{Domain}/client/api/sendmessage?apikey={apikey}&mobiles={mobileno}&sms={message}&senderid={senderid}&schedule={schedule}&sending-time={dd-MM-yyyy HH:mm:ss}& client-sms-ids={id}&unicode={yes}&message-type={messageType}"
headers = {}
response = requests.request(
"GET",
url,
headers=headers
)
print(response.json())<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{Domain}/client/api/sendmessage?apikey={apikey}&mobiles={mobileno}&sms={message}&senderid={senderid}&schedule={schedule}&sending-time={dd-MM-yyyy HH:mm:ss}& client-sms-ids={id}&unicode={yes}&message-type={messageType}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET"
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Request body
JSON body
{
"apikey": "",
"senderid": "",
"unicode": "",
"schedule": "",
"sending-time": "",
"sms-list": [
{
"message": "",
"mobiles": "",
"client-sms-ids": ""
},
{
"message": "",
"mobiles": "",
"client-sms-ids": ""
}
]
}
Response example
JSON response
{
"status": {
"error-code": "",
"error-status": "",
"error-description": ""
},
"sms-response-details": [
{
"success-count": "",
"failed-sms-details": [
{
"count": "",
"reasons": [
{
"sms-client-id": "",
"mobile-no": "",
"failed-reason": "",
"message-content": ""
}
]
}
],
"sent-sms-details": [
{
"sms-client-id": "",
"message-id": "",
"mobile-no": ""
}
]
}
]
}