Send Bulk SMS
This API feature will give you the ability to send SMS messages 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 |
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
var client = new RestClient("https://api.libyasms.com:3236/sendtext?apikey=7969ea24f713e424&secretkey=c7fba893&callerID=LibyaSMS&toUser=218915063556&messageContent=Hello World");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
var request = http.Request('GET', Uri.parse('https://api.libyasms.com:3236/sendtext?apikey=7969ea24f713e424&secretkey=c7fba893&callerID=LibyaSMS&toUser=218915063556&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/sendtext?apikey=7969ea24f713e424&secretkey=c7fba893&callerID=LibyaSMS&toUser=218915063556&messageContent=Hello%20World',
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/sendtext?apikey=7969ea24f713e424&secretkey=c7fba893&callerID=LibyaSMS&toUser=218915063556&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", "/sendtext?apikey=7969ea24f713e424&secretkey=c7fba893&callerID=LibyaSMS&toUser=218915063556&messageContent=Hello%20World", 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/sendtext?apikey=7969ea24f713e424&secretkey=c7fba893&callerID=LibyaSMS&toUser=218915063556&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/sendtext?apikey=7969ea24f713e424&secretkey=c7fba893&callerID=LibyaSMS&toUser=218915063556&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()