Multiple SMS Messages
This API feature will give you the ability to send multiple SMS messages at once to single or multiple receivers using the same API.
The base URL to use for this service is https://api.libyasms.com:3236/. The base URL cannot be used on its own; you must append a path that identifies an operation and you may have to specify some path parameters as well.
Parameters
Parameter | Value | Required |
---|---|---|
apikey | apikey provided by Libya SMS | Yes |
secretkey | secretkey provided by Libya SMS | Yes |
content | JSON formatted array of SMS. Described bellow. |
Yes |
Content parameter explained:
Parameter | Value | Required |
---|---|---|
callerID | your approved sender id | Yes |
toUser | Semicolon separated receivers phone numbers including country code without + or 00, for example 218915063556,218925063556 with no space between numbrs |
Yes |
messageContent | SMS text message contents | Yes |
Request
curl --location -g --request GET 'https://api.libyasms.com:3236/send?apikey=a27db8440691e7b5&secretkey=fe7ed9f6&content=[
{
"callerID": "LibyaSMS",
"toUser": "218915063556,218925063556",
"messageContent": "Good Morning"
},
{
"callerID": "LibyaSMS",
"toUser": "218945063556",
"messageContent": "Hello World"
}
]'
var client = new RestClient("https://api.libyasms.com:3236/send?apikey=a27db8440691e7b5&secretkey=fe7ed9f6&content=[
{
\"callerID\": \"LibyaSMS\",
\"toUser\": \"218915063556,218925063556\",
\"messageContent\": \"Good Morning\"
},
{
\"callerID\": \"LibyaSMS\",
\"toUser\": \"218945063556\",
\"messageContent\": \"Hello World\"
}
]");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
var request = http.Request('GET', Uri.parse('https://api.libyasms.com:3236/send?apikey=a27db8440691e7b5&secretkey=fe7ed9f6&content=[
{
"callerID": "LibyaSMS",
"toUser": "218915063556,218925063556",
"messageContent": "Good Morning"
},
{
"callerID": "LibyaSMS",
"toUser": "218945063556",
"messageContent": "Hello World"
}
]'));
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.libyasms.com:3236/send?apikey=a27db8440691e7b5&secretkey=fe7ed9f6&content=%5B%0A%20%20%7B%0A%20%20%20%20%22callerID%22:%20%22LibyaSMS%22,%0A%20%20%20%20%22toUser%22:%20%22218915063556,218925063556%22,%0A%20%20%20%20%22messageContent%22:%20%22Good%20Morning%22%0A%20%20%7D,%0A%20%20%7B%0A%20%20%20%20%22callerID%22:%20%22LibyaSMS%22,%0A%20%20%20%20%22toUser%22:%20%22218945063556%22,%0A%20%20%20%20%22messageContent%22:%20%22H ello%20World%22%0A%20%20%7D%0A%5D',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.libyasms.com:3236/send?apikey=a27db8440691e7b5&secretkey=fe7ed9f6&content=[
{
\"callerID\": \"LibyaSMS\",
\"toUser\": \"218915063556,218925063556\",
\"messageContent\": \"Good Morning\"
},
{
\"callerID\": \"LibyaSMS\",
\"toUser\": \"218945063556\",
\"messageContent\": \"Hello World\"
}
]")
.method("GET", body)
.build();
Response response = client.newCall(request).execute();
import http.client
conn = http.client.HTTPSConnection("api.libyasms.com", 3236)
payload = ''
headers = {}
conn.request("GET", "/send?apikey=a27db8440691e7b5&secretkey=fe7ed9f6&content=%5B%0A%20%20%7B%0A%20%20%20%20%22callerID%22:%20%22LibyaSMS%22,%0A%20%20%20%20%22toUser%22:%20%22218915063556,218925063556%22,%0A%20%20%20%20%22messageContent%22:%20%22Good%20Morning%22%0A%20%20%7D,%0A%20%20%7B%0A%20%20%20%20%22callerID%22:%20%22LibyaSMS%22,%0A%20%20%20%20%22toUser%22:%20%22218945063556%22,%0A%20%20%20%20%22messageContent%22:%20%22Hello%20World%22%0A%20%20%7D%0A%5D", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require "uri"
require "net/http"
url = URI("https://api.libyasms.com:3236/send?apikey=a27db8440691e7b5&secretkey=fe7ed9f6&content=[
{
\"callerID\": \"LibyaSMS\",
\"toUser\": \"218915063556,218925063556\",
\"messageContent\": \"Good Morning\"
},
{
\"callerID\": \"LibyaSMS\",
\"toUser\": \"218945063556\",
\"messageContent\": \"Hello World\"
}
]")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
response = https.request(request)
puts response.read_body
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
var request = URLRequest(url: URL(string: "https://api.libyasms.com:3236/send?apikey=a27db8440691e7b5&secretkey=fe7ed9f6&content=[
{
\"callerID\": \"LibyaSMS\",
\"toUser\": \"218915063556,218925063556\",
\"messageContent\": \"Good Morning\"
},
{
\"callerID\": \"LibyaSMS\",
\"toUser\": \"218945063556\",
\"messageContent\": \"Hello World\"
}
]")!,timeoutInterval: Double.infinity)
request.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
semaphore.signal()
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()