Appearance
User - SMS
Base URL:
https://your-domain.com
Admin endpoints for sending SMS messages. All endpoints require admin/staff authentication.
Send SMS
Send SMS to a specific phone number.
| Property | Value |
|---|---|
| Endpoint | Send SMS |
| Method | POST |
| URL | /api/v1/sms/send |
| Authentication | Bearer Token |
Request Headers:
| Header | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
Accept | application/json | Yes |
Authorization | Bearer your-auth-token | Yes |
Request Body:
json
{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"phone": "01712345678",
"message": "Your bill is due. Please pay soon."
}| Parameter | Type | Required | Description |
|---|---|---|---|
phone | string | Yes | Recipient phone number |
message | string | Yes | SMS message content |
Success Response (200 OK):
json
{
"success": true,
"message": "SMS sent successfully",
"data": {
"message_id": "MSG123456"
}
}Error Response (400 Bad Request):
json
{
"success": false,
"message": "SMS sending failed: Invalid phone number"
}Code Examples:
bash
curl -X POST "https://your-domain.com/api/v1/sms/send" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-auth-token" \
-d '{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"phone": "01712345678",
"message": "Your bill is due. Please pay soon."
}'php
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://your-domain.com']);
$response = $client->request('POST', '/api/v1/sms/send', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer your-auth-token',
],
'json' => [
'isp_id' => 1,
'branch_id' => 1,
'user_id' => 1,
'phone' => '01712345678',
'message' => 'Your bill is due. Please pay soon.',
],
]);
$data = json_decode($response->getBody(), true);
print_r($data);javascript
const BASE_URL = 'https://your-domain.com';
const TOKEN = 'your-auth-token';
const response = await fetch(`${BASE_URL}/api/v1/sms/send`, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
Authorization: `Bearer ${TOKEN}`,
},
body: JSON.stringify({
isp_id: 1,
branch_id: 1,
user_id: 1,
phone: '01712345678',
message: 'Your bill is due. Please pay soon.',
}),
});
const data = await response.json();
console.log(data);python
import requests
BASE_URL = "https://your-domain.com"
TOKEN = "your-auth-token"
response = requests.post(
f"{BASE_URL}/api/v1/sms/send",
headers={
"Accept": "application/json",
"Authorization": f"Bearer {TOKEN}",
},
json={
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"phone": "01712345678",
"message": "Your bill is due. Please pay soon.",
},
)
data = response.json()
print(data)go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
const baseURL = "https://your-domain.com"
const token = "your-auth-token"
func main() {
endpoint := baseURL + "/api/v1/sms/send"
payload, _ := json.Marshal(map[string]any{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"phone": "01712345678",
"message": "Your bill is due. Please pay soon.",
})
req, _ := http.NewRequest("POST", endpoint, bytes.NewBuffer(payload))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(body))
}rust
use reqwest::Client;
use serde_json::json;
const BASE_URL: &str = "https://your-domain.com";
const TOKEN: &str = "your-auth-token";
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let response = client
.post(format!("{BASE_URL}/api/v1/sms/send"))
.header("Accept", "application/json")
.bearer_auth(TOKEN)
.json(&json!({
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"phone": "01712345678",
"message": "Your bill is due. Please pay soon."
}))
.send()
.await?;
let data: serde_json::Value = response.json().await?;
println!("{data:#}");
Ok(())
}Send SMS to Subscriber
Send SMS to a subscriber using their registered phone number.
| Property | Value |
|---|---|
| Endpoint | Send SMS to Subscriber |
| Method | POST |
| URL | /api/v1/sms/send-to-subscriber |
| Authentication | Bearer Token |
Request Body:
json
{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"subscriber_id": 1,
"message": "Your package expires tomorrow."
}| Parameter | Type | Required | Description |
|---|---|---|---|
subscriber_id | integer | Yes | Subscriber ID |
message | string | Yes | SMS message content |
Success Response (200 OK):
json
{
"success": true,
"message": "SMS sent successfully"
}Code Examples:
bash
curl -X POST "https://your-domain.com/api/v1/sms/send-to-subscriber" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-auth-token" \
-d '{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"subscriber_id": 1,
"message": "Your package expires tomorrow."
}'php
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://your-domain.com']);
$response = $client->request('POST', '/api/v1/sms/send-to-subscriber', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer your-auth-token',
],
'json' => [
'isp_id' => 1,
'branch_id' => 1,
'user_id' => 1,
'subscriber_id' => 1,
'message' => 'Your package expires tomorrow.',
],
]);
$data = json_decode($response->getBody(), true);
print_r($data);javascript
const BASE_URL = 'https://your-domain.com';
const TOKEN = 'your-auth-token';
const response = await fetch(`${BASE_URL}/api/v1/sms/send-to-subscriber`, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
Authorization: `Bearer ${TOKEN}`,
},
body: JSON.stringify({
isp_id: 1,
branch_id: 1,
user_id: 1,
subscriber_id: 1,
message: 'Your package expires tomorrow.',
}),
});
const data = await response.json();
console.log(data);python
import requests
BASE_URL = "https://your-domain.com"
TOKEN = "your-auth-token"
response = requests.post(
f"{BASE_URL}/api/v1/sms/send-to-subscriber",
headers={
"Accept": "application/json",
"Authorization": f"Bearer {TOKEN}",
},
json={
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"subscriber_id": 1,
"message": "Your package expires tomorrow.",
},
)
data = response.json()
print(data)go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
const baseURL = "https://your-domain.com"
const token = "your-auth-token"
func main() {
endpoint := baseURL + "/api/v1/sms/send-to-subscriber"
payload, _ := json.Marshal(map[string]any{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"subscriber_id": 1,
"message": "Your package expires tomorrow.",
})
req, _ := http.NewRequest("POST", endpoint, bytes.NewBuffer(payload))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(body))
}rust
use reqwest::Client;
use serde_json::json;
const BASE_URL: &str = "https://your-domain.com";
const TOKEN: &str = "your-auth-token";
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let response = client
.post(format!("{BASE_URL}/api/v1/sms/send-to-subscriber"))
.header("Accept", "application/json")
.bearer_auth(TOKEN)
.json(&json!({
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"subscriber_id": 1,
"message": "Your package expires tomorrow."
}))
.send()
.await?;
let data: serde_json::Value = response.json().await?;
println!("{data:#}");
Ok(())
}Send Bulk SMS
Send SMS to multiple subscribers at once.
| Property | Value |
|---|---|
| Endpoint | Send Bulk SMS |
| Method | POST |
| URL | /api/v1/sms/send-bulk |
| Authentication | Bearer Token |
Request Body:
json
{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"subscriber_ids": [1, 2, 3, 4, 5],
"message": "Important notice: Scheduled maintenance tonight."
}| Parameter | Type | Required | Description |
|---|---|---|---|
subscriber_ids | array | Yes | Array of subscriber IDs |
message | string | Yes | SMS message content |
Success Response (200 OK):
json
{
"success": true,
"message": "Bulk SMS sent successfully",
"data": {
"total": 5,
"sent": 5,
"failed": 0
}
}Code Examples:
bash
curl -X POST "https://your-domain.com/api/v1/sms/send-bulk" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-auth-token" \
-d '{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"subscriber_ids": [
1,
2,
3,
4,
5
],
"message": "Important notice: Scheduled maintenance tonight."
}'php
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://your-domain.com']);
$response = $client->request('POST', '/api/v1/sms/send-bulk', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer your-auth-token',
],
'json' => [
'isp_id' => 1,
'branch_id' => 1,
'user_id' => 1,
'subscriber_ids' => [
1,
2,
3,
4,
5,
],
'message' => 'Important notice: Scheduled maintenance tonight.',
],
]);
$data = json_decode($response->getBody(), true);
print_r($data);javascript
const BASE_URL = 'https://your-domain.com';
const TOKEN = 'your-auth-token';
const response = await fetch(`${BASE_URL}/api/v1/sms/send-bulk`, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
Authorization: `Bearer ${TOKEN}`,
},
body: JSON.stringify({
isp_id: 1,
branch_id: 1,
user_id: 1,
subscriber_ids: [
1,
2,
3,
4,
5,
],
message: 'Important notice: Scheduled maintenance tonight.',
}),
});
const data = await response.json();
console.log(data);python
import requests
BASE_URL = "https://your-domain.com"
TOKEN = "your-auth-token"
response = requests.post(
f"{BASE_URL}/api/v1/sms/send-bulk",
headers={
"Accept": "application/json",
"Authorization": f"Bearer {TOKEN}",
},
json={
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"subscriber_ids": [
1,
2,
3,
4,
5,
],
"message": "Important notice: Scheduled maintenance tonight.",
},
)
data = response.json()
print(data)go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
const baseURL = "https://your-domain.com"
const token = "your-auth-token"
func main() {
endpoint := baseURL + "/api/v1/sms/send-bulk"
payload, _ := json.Marshal(map[string]any{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"subscriber_ids": []any{
1,
2,
3,
4,
5,
},
"message": "Important notice: Scheduled maintenance tonight.",
})
req, _ := http.NewRequest("POST", endpoint, bytes.NewBuffer(payload))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(body))
}rust
use reqwest::Client;
use serde_json::json;
const BASE_URL: &str = "https://your-domain.com";
const TOKEN: &str = "your-auth-token";
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let response = client
.post(format!("{BASE_URL}/api/v1/sms/send-bulk"))
.header("Accept", "application/json")
.bearer_auth(TOKEN)
.json(&json!({
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"subscriber_ids": [
1,
2,
3,
4,
5
],
"message": "Important notice: Scheduled maintenance tonight."
}))
.send()
.await?;
let data: serde_json::Value = response.json().await?;
println!("{data:#}");
Ok(())
}