API documentation
Send SMS from your own website, app, or system with the SMS365 API.
Get started
https://sms365.clasnettechnologies.com/api/send_message
The SMS365 API lets developers add bulk SMS to their own applications. Send one message to many phone numbers in a single request, and the cost is taken from your SMS365 balance.
To use it you need a Bearer token and an approved Sender ID. After you sign up and confirm your email, create both in the dashboard under Developers → Tokens and Sender Ids.
Request body
{
"sender_id": "SMS365",
"numbers": "0970000001,0960000002",
"message": "Good afternoon"
}
Fields
| Field | Type | Description |
|---|---|---|
sender_id | String | Your approved Sender ID. This is the name people see as the sender. |
numbers | String | One or more phone numbers, separated by commas. |
message | String | The text of the SMS. |
cURL
Replace YOUR_API_TOKEN and the Sender ID with your own.
curl --location --request GET 'https://sms365.clasnettechnologies.com/api/send_message' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--data-raw '{
"sender_id": "SMS365",
"numbers": "0970000001,0960000002",
"message": "Good afternoon"
}'
Query parameters
| Field | Type | Description |
|---|---|---|
Authorization | String | Your Bearer token. |
Content-Type | String | application/json |
Accept | String | application/json |
C-Sharp
Replace YOUR_API_TOKEN and the Sender ID with your own.
var client = new RestClient("https://sms365.clasnettechnologies.com/api/send_message");
var request = new RestRequest(Method.GET);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("Authorization", "Bearer YOUR_API_TOKEN");
request.AddParameter("application/json",
"{\"sender_id\":\"SMS365\",\"numbers\":\"0970000001,0960000002\",\"message\":\"Good afternoon\"}",
ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Query parameters
| Field | Type | Description |
|---|---|---|
Authorization | String | Your Bearer token. |
Content-Type | String | application/json |
Accept | String | application/json |
Java
Replace YOUR_API_TOKEN and the Sender ID with your own.
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType,
"{\"sender_id\":\"SMS365\",\"numbers\":\"0970000001,0960000002\",\"message\":\"Good afternoon\"}");
Request request = new Request.Builder()
.url("https://sms365.clasnettechnologies.com/api/send_message")
.method("GET", body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("Authorization", "Bearer YOUR_API_TOKEN")
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
Query parameters
| Field | Type | Description |
|---|---|---|
Authorization | String | Your Bearer token. |
Content-Type | String | application/json |
Accept | String | application/json |
JavaScript
Replace YOUR_API_TOKEN and the Sender ID with your own.
// Browsers drop the body of GET requests, so send the fields as query parameters.
const params = new URLSearchParams({
sender_id: "SMS365",
numbers: "0970000001,0960000002",
message: "Good afternoon",
});
const response = await fetch(`https://sms365.clasnettechnologies.com/api/send_message?${params}`, {
method: "GET",
headers: {
Accept: "application/json",
Authorization: "Bearer YOUR_API_TOKEN",
},
});
console.log(response.status, await response.json());
Query parameters
| Field | Type | Description |
|---|---|---|
Authorization | String | Your Bearer token. |
Content-Type | String | application/json |
Accept | String | application/json |
Objective-C
Replace YOUR_API_TOKEN and the Sender ID with your own.
#import <Foundation/Foundation.h>
NSMutableURLRequest *request = [NSMutableURLRequest
requestWithURL:[NSURL URLWithString:@"https://sms365.clasnettechnologies.com/api/send_message"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setAllHTTPHeaderFields:@{
@"Content-Type": @"application/json",
@"Accept": @"application/json",
@"Authorization": @"Bearer YOUR_API_TOKEN"
}];
[request setHTTPBody:[@"{\"sender_id\":\"SMS365\",\"numbers\":\"0970000001,0960000002\",\"message\":\"Good afternoon\"}"
dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPMethod:@"GET"];
[[[NSURLSession sharedSession] dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
NSLog(@"%@", error ?: [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
}] resume];
Query parameters
| Field | Type | Description |
|---|---|---|
Authorization | String | Your Bearer token. |
Content-Type | String | application/json |
Accept | String | application/json |
PHP
Replace YOUR_API_TOKEN and the Sender ID with your own.
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://sms365.clasnettechnologies.com/api/send_message',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS => json_encode([
'sender_id' => 'SMS365',
'numbers' => '0970000001,0960000002',
'message' => 'Good afternoon',
]),
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Accept: application/json',
'Authorization: Bearer YOUR_API_TOKEN',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Query parameters
| Field | Type | Description |
|---|---|---|
Authorization | String | Your Bearer token. |
Content-Type | String | application/json |
Accept | String | application/json |
Python
Replace YOUR_API_TOKEN and the Sender ID with your own.
import http.client
import json
conn = http.client.HTTPSConnection("sms365.clasnettechnologies.com")
payload = json.dumps({
"sender_id": "SMS365",
"numbers": "0970000001,0960000002",
"message": "Good afternoon"
})
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
conn.request("GET", "/api/send_message", payload, headers)
response = conn.getresponse()
print(response.status, response.read().decode("utf-8"))
Query parameters
| Field | Type | Description |
|---|---|---|
Authorization | String | Your Bearer token. |
Content-Type | String | application/json |
Accept | String | application/json |
Ruby
Replace YOUR_API_TOKEN and the Sender ID with your own.
require "uri"
require "json"
require "net/http"
url = URI("https://sms365.clasnettechnologies.com/api/send_message")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Bearer YOUR_API_TOKEN"
request.body = JSON.dump({
"sender_id" => "SMS365",
"numbers" => "0970000001,0960000002",
"message" => "Good afternoon"
})
response = http.request(request)
puts response.read_body
Query parameters
| Field | Type | Description |
|---|---|---|
Authorization | String | Your Bearer token. |
Content-Type | String | application/json |
Accept | String | application/json |
Success
The SMS365 API uses the following success status code:
| Status code | Meaning |
|---|---|
| 202 | Accepted. The request was accepted for delivery. |
Example response
{
"success": "true",
"message": "Messages accepted for delivery"
}
Errors
The SMS365 API uses the following error codes. Each error response has "success": "false" and a message that explains why.
| Error code | Meaning |
|---|---|
| 401 | Unauthenticated. The token is missing or not valid. |
| 422 | Unprocessable entity. The Sender ID is not approved, or your SMS balance is too low. |
| 500 | Internal processing error. Try again shortly. |
Example response
{
"success": "false",
"message": "Insufficient SMS Balance of: 5 to send all the message(s)"
}
Ready to start sending?
Create your SMS365 account, then add an API token and Sender ID from the dashboard.