Appearance
Send Recurring SMS POST METHOD
PARAMETERS
API URL : https://api.icsms.net/sendsms/
apikey (string : required)
apikey helps to identify the user making the request. Sign/login for your apikey
from (string : required)
This represents the sender id for the message
to (string : required)
This is a string of comma seperated mobile numbers, eg 0570120200,0562123456
message (string : required)
This represents the body of message sent as SMS
type (string: required)
For recurring SMS pass this as "recurring". Required for recurring SMS.
expectedDeliveryTime (string: required)
This represents the initial delivery time, this should be passed as YYYY-MM-DD HH:HH:MM eg. "2021-07-29 06:30:10". Required for recurring SMS.
recurringPeriod (string: required)
This represents the recurring period of SMS. The value can either be "Hourly", "Daily", "Monthly" or "Yearly". Required for recurring SMS.
recurringInterval (string: required)
This works with recurringPeriod. If you want SMS so repeat every 2 days, you pass recurringPeriod as "Daily" and recurringInterval as "2"
encode (boolean : optional)
Pass this value true (boolean) if you want your SMS to support special characters like emojis, latin, arabic, chinese etc, otherwise do not include this field in your payload
EXPECTED RESPONSE
json
status - 200 ok
{ "status": "successful", "message": "Thank you for choosing us, your Recurring SMS has been saved and will be delivered at the appropriate time", "messageId": "123456789" }
Javascript
js
const apikey = "1W3N4KHD28YCBL8M7WDG0L11N73FP28JKD5SOKD2D4KXJKCKMF"
var from = "ICSMS"
var to = "0570120200,0562123456"
var message = "Testing Recurring SMS"
var type = "recurring"
var expectedDeliveryTime = "2021-07-29 06:30:10"
var recurringPeriod = "Daily"
var recurringInterval = 2
var myHeaders = new Headers();
myHeaders.append("Authorization", `Bearer ${apikey}`);
myHeaders.append("Content-Type", "application/json");
var payload = JSON.stringify({
"from": from,
"to": to,
"message": message,
"type": type,
"expectedDeliveryTime": expectedDeliveryTime,
"recurringPeriod": recurringPeriod,
"recurringInterval": recurringInterval
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: payload,
redirect: 'follow'
};
fetch("https://api.icsms.net/sendsms/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
NodeJS
js
const axios = require('axios');
const apikey = "1W3N4KHD28YCBL8M7WDG0L11N73FP28JKD5SOKD2D4KXJKCKMF"
let from = "ICSMS"
let to = "0570120200,0562123456"
let message = "Testing Recurring SMS"
let type = "recurring"
let expectedDeliveryTime = "2021-07-29 06:30:10"
let recurringPeriod = "Daily"
let recurringInterval = 2
let data = JSON.stringify({
"from": from,
"to": to,
"message": message,
"type": type,
"expectedDeliveryTime": expectedDeliveryTime,
"recurringPeriod": recurringPeriod,
"recurringInterval": recurringInterval
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.icsms.net/sendsms/',
headers: {
'Authorization': `Bearer ${apikey}`,
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
PHP
php
<?php
$curl = curl_init();
$apikey = "1W3N4KHD28YCBL8M7WDG0L11N73FP28JKD5SOKD2D4KXJKCKMF";
$from = "ICSMS";
$to = "0570120200,0562123456";
$message = "Testing Recurring SMS";
$type = "recurring";
$expectedDeliveryTime = "2021-07-29 06:30:10";
$recurringPeriod = "Daily";
$recurringInterval = 2;
$request = array(
"from"=>$from,
"to"=> $to,
"message"=>$message,
"type"=>$type,
"expectedDeliveryTime"=>$expectedDeliveryTime,
"recurringPeriod"=>$recurringPeriod,
"recurringInterval"=>$recurringInterval
);
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.icsms.net/sendsms/',
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 =>json_encode($request),
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer '.$apikey,
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Python
python
import requests
url = "https://api.icsms.net/sendsms/"
apikey = "1W3N4KHD28YCBL8M7WDG0L11N73FP28JKD5SOKD2D4KXJKCKMF"
sender_id = "ICSMS"
to = "0570120200,0562123456"
message = "Testing Recurring SMS"
type_of_message = "recurring"
expectedDeliveryTime = "2021-07-29 06:30:10"
recurringPeriod = "Daily"
recurringInterval = 2
payload = json.dumps({
"from": sender_id,
"to": to,
"message": message,
"type": type_of_message,
"expectedDeliveryTime": expectedDeliveryTime,
"recurringPeriod": recurringPeriod,
"recurringInterval": recurringInterval
})
headers = {
'Authorization': 'Bearer {}'.format(apikey),
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.json())
C#
c#
var options = new RestClientOptions("https://api.icsms.net")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/sendsms/", Method.Post);
request.AddHeader("Authorization", "Bearer 1W3N4KHD28YCBL8M7WDG0L11N73FP28JKD5SOKD2D4KXJKCKMF");
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@" ""from"":""ICSMS"",
" + "\n" +
@" ""to"":""0570120200,0562123456"",
" + "\n" +
@" ""message"":""Testing Recurring SMS"",
" + "\n" +
@" ""type"":""recurring"",
" + "\n" +
@" ""expectedDeliveryTime"":""2021-07-29 06:30:10"",
" + "\n" +
@" ""recurringPeriod"":""Daily"",
" + "\n" +
@" ""recurringInterval"": 2
" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
Java
java
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.icsms.net/sendsms/")
.header("Authorization", "Bearer 1W3N4KHD28YCBL8M7WDG0L11N73FP28JKD5SOKD2D4KXJKCKMF")
.header("Content-Type", "application/json")
.body("{\r\n \"from\":\"ICSMS\",\r\n \"to\":\"0570120200,0562123456\",\r\n \"message\":\"Testing Recurring SMS\",\r\n \"type\":\"recurring\",\r\n \"expectedDeliveryTime\":\"2021-07-29 06:30:10\",\r\n \"recurringPeriod\":\"Daily\",\r\n \"recurringInterval\": 2\r\n}")
.asString();