Developer Documentation
Integrate i60msg SMS into your software, apps, or websites with our REST API.
API Access
Generate API keys from your customer dashboard under API Keys.
Authentication
Secure your requests by including your API Key in the request header. We support three ways to authenticate:
# Header Option 1
Authorization: Bearer YOUR_API_KEY
# Header Option 2
X-API-Key: YOUR_API_KEY
# Query Parameter
POST https://www.i60msg.online/api/sms/send?api_key=YOUR_API_KEY
Base Configuration
| Endpoint | https://www.i60msg.online/api/sms/send |
| Method | POST |
| Content-Type | application/json |
Parameters
| Parameter | Type | Description |
|---|---|---|
| to | String | Array | Required. Recipient phone number(s). Can be a comma-separated string or an array of strings. Maximum 200 recipients per request. |
| message | String | Required. The text message content. |
| from | String | Optional. Sender name (e.g. AUTOREG). If omitted (and sender_id is omitted), the system uses your latest active sender (or i60msg). |
| sender_id | Number | Optional. Sender database ID (numeric). If provided, it must belong to the customer. |
| channel | String | Optional. The SMS route: generic (default) or dnd. |
Request Example
{
"to": ["08012345678", "08087654321"],
"message": "Hello from my application",
"channel": "generic",
"sender_id": 1
}
Sample Code
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://www.i60msg.online/api/sms/send',
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([
"to" => ["2348012345678", "2348098765432"],
"message" => "Hello from Postman test",
"channel" => "generic"
]),
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
const myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer YOUR_API_KEY");
myHeaders.append("Content-Type", "application/json");
const raw = JSON.stringify({
"to": ["2348012345678", "2348098765432"],
"message": "Hello from Postman test",
"channel": "generic"
});
const requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow"
};
fetch("https://www.i60msg.online/api/sms/send", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
import requests
import json
url = "https://www.i60msg.online/api/sms/send"
payload = json.dumps({
"to": ["2348012345678", "2348098765432"],
"message": "Hello from Postman test",
"channel": "generic"
})
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://www.i60msg.online/api/sms/send"
method := "POST"
payload := strings.NewReader(`{
"to": ["2348012345678", "2348098765432"],
"message": "Hello from Postman test",
"channel": "generic"
}`)
client := &http.Client {}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Bearer YOUR_API_KEY")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://www.i60msg.online/api/sms/send");
request.Headers.Add("Authorization", "Bearer YOUR_API_KEY");
var content = new StringContent("{\n \"to\": [\"2348012345678\", \"2348098765432\"],\n \"message\": \"Hello from Postman test\",\n \"channel\": \"generic\"\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"to\": [\"2348012345678\", \"2348098765432\"],\n \"message\": \"Hello from Postman test\",\n \"channel\": \"generic\"\n}");
Request request = new Request.Builder()
.url("https://www.i60msg.online/api/sms/send")
.method("POST", body)
.addHeader("Authorization", "Bearer YOUR_API_KEY")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
Responses
Success Response (200 OK)
{
"ok": true,
"attempted": 2,
"sent": 2,
"failed": 0,
"invalid": 0,
"units_used": 2,
"remaining": 0,
"reference": "API-ABC123XYZ",
"failures": []
}
Error Response (422 Unprocessable Entity)
{
"ok": false,
"message": "Insufficient units."
}
Error Response (423 Locked)
{
"ok": false,
"message": "Sending is currently paused."
}
Important Notes
- Number Normalization: Numbers are normalized before sending.
- Rate Limiting: Requests are throttled based on your API key limit.
- Unit Calculation: Long SMS may use more than one unit.