MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by following these steps:

Contact Us

POST api/contact-us

requires authentication

Example request:
curl --request POST \
    "https://sms.lamah.com/api/contact-us" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"name\": \"soluta\",
    \"phone\": \"corporis\",
    \"subject\": \"sed\",
    \"email\": \"[email protected]\",
    \"message\": \"dolorem\"
}"
const url = new URL(
    "https://sms.lamah.com/api/contact-us"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "soluta",
    "phone": "corporis",
    "subject": "sed",
    "email": "[email protected]",
    "message": "dolorem"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


json {"message": "string"}
 

Request      

POST api/contact-us

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Body Parameters

name   required  optional    

string Example: soluta

phone   required  optional    

string Example: corporis

subject   required  optional    

string Example: sed

email   required  optional    

string Example: [email protected]

message   required  optional    

string Example: dolorem

Endpoints

GET api/faq

requires authentication

Example request:
curl --request GET \
    --get "https://sms.lamah.com/api/faq" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}"
const url = new URL(
    "https://sms.lamah.com/api/faq"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "data": [
        {
            "question": "كيف يمكنني الاشتراك؟",
            "answer": "للاشتراك في الخدمة، قم بزيارة موقع  وانقر على زر 'التسجيل'. املأ نموذج التسجيل بتفاصيلك، واختر خطة الاشتراك التي تناسب احتياجاتك، وأكمل عملية الدفع. بمجرد الانتهاء، ستتلقى رسالة تأكيد عبر البريد الإلكتروني للبدء!"
        }
    ]
}
 

Request      

GET api/faq

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

GET api/cities

requires authentication

Example request:
curl --request GET \
    --get "https://sms.lamah.com/api/cities" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}"
const url = new URL(
    "https://sms.lamah.com/api/cities"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "data": [
        {
            "name": "مصراتة",
            "description": null
        },
        {
            "name": "طرابلس",
            "description": null
        },
        {
            "name": "الزنتان",
            "description": null
        },
        {
            "name": "الزاوية",
            "description": null
        },
        {
            "name": "الخمس",
            "description": null
        },
        {
            "name": "زوارة",
            "description": null
        },
        {
            "name": "ترهونة",
            "description": null
        },
        {
            "name": "العزيزية",
            "description": null
        },
        {
            "name": "غريان",
            "description": null
        },
        {
            "name": "بنغازي",
            "description": null
        },
        {
            "name": "البيضاء",
            "description": null
        },
        {
            "name": "درنة",
            "description": null
        },
        {
            "name": "طبرق",
            "description": null
        },
        {
            "name": "اجدابيا",
            "description": null
        },
        {
            "name": "المرج",
            "description": null
        },
        {
            "name": "شحات",
            "description": null
        },
        {
            "name": "سرت",
            "description": null
        },
        {
            "name": "سبها",
            "description": null
        },
        {
            "name": "مرزق",
            "description": null
        },
        {
            "name": "أوباري",
            "description": null
        },
        {
            "name": "غات",
            "description": null
        },
        {
            "name": "براك الشاطئ",
            "description": null
        },
        {
            "name": "القطرون",
            "description": null
        },
        {
            "name": "نالوت",
            "description": null
        }
    ]
}
 

Request      

GET api/cities

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

OTP

POST api/otp/initiate

requires authentication

Example request:
curl --request POST \
    "https://sms.lamah.com/api/otp/initiate" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"lang\": \"dolorem\",
    \"length\": \"sequi\",
    \"expiration\": \"inventore\",
    \"sender\": \"fuga\",
    \"payment_type\": \"deserunt\",
    \"receiver\": \"ipsa\"
}"
const url = new URL(
    "https://sms.lamah.com/api/otp/initiate"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "lang": "dolorem",
    "length": "sequi",
    "expiration": "inventore",
    "sender": "fuga",
    "payment_type": "deserunt",
    "receiver": "ipsa"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


json {"request_id": "string", "cost": int}
 

Request      

POST api/otp/initiate

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Body Parameters

lang   required  optional    

string [ar, en] Example: dolorem

length   required  optional    

int [4, 6] Example: sequi

expiration   required  optional    

int between 1 and 10 minutes Example: inventore

sender   required  optional    

string Example: fuga

payment_type   required  optional    

string [wallet, subscription] Example: deserunt

receiver   required  optional    

phone number Example: ipsa

POST api/otp/verify

requires authentication

Example request:
curl --request POST \
    "https://sms.lamah.com/api/otp/verify" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"request_id\": \"rerum\",
    \"code\": \"laudantium\"
}"
const url = new URL(
    "https://sms.lamah.com/api/otp/verify"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "request_id": "rerum",
    "code": "laudantium"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


json {"message": "string"}
 

Request      

POST api/otp/verify

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Body Parameters

request_id   required  optional    

string Example: rerum

code   required  optional    

string Example: laudantium

Plan

GET api/plans

Example request:
curl --request GET \
    --get "https://sms.lamah.com/api/plans"
const url = new URL(
    "https://sms.lamah.com/api/plans"
);

fetch(url, {
    method: "GET",
}).then(response => response.json());

Example response (200):


json
 

Request      

GET api/plans

Project

GET api/project/details

requires authentication

Example request:
curl --request GET \
    --get "https://sms.lamah.com/api/project/details" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}"
const url = new URL(
    "https://sms.lamah.com/api/project/details"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


json
 

Request      

GET api/project/details

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

GET api/project/balance

requires authentication

Example request:
curl --request GET \
    --get "https://sms.lamah.com/api/project/balance" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}"
const url = new URL(
    "https://sms.lamah.com/api/project/balance"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


json
 

Request      

GET api/project/balance

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

GET api/project/contacts/{group_id}

requires authentication

Example request:
curl --request GET \
    --get "https://sms.lamah.com/api/project/contacts/ab" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"page\": 16,
    \"per_page\": 5,
    \"from\": \"quas\",
    \"to\": \"et\",
    \"group_id\": \"89033fe6-5141-371e-8446-0ee5dd03c166\"
}"
const url = new URL(
    "https://sms.lamah.com/api/project/contacts/ab"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "page": 16,
    "per_page": 5,
    "from": "quas",
    "to": "et",
    "group_id": "89033fe6-5141-371e-8446-0ee5dd03c166"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


json
 

Request      

GET api/project/contacts/{group_id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

URL Parameters

group_id   string     

The ID of the group. Example: ab

Body Parameters

page   integer  optional    

nullable Example: 16

per_page   integer  optional    

nullable Example: 5

from   date  optional    

nullable Example: quas

to   date  optional    

nullable Example: et

group_id   string  optional    

validation.uuid. Example: 89033fe6-5141-371e-8446-0ee5dd03c166

GET api/project/consumptions

requires authentication

Example request:
curl --request GET \
    --get "https://sms.lamah.com/api/project/consumptions" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"page\": 6,
    \"per_page\": 16,
    \"from\": \"voluptatem\",
    \"to\": \"iusto\"
}"
const url = new URL(
    "https://sms.lamah.com/api/project/consumptions"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "page": 6,
    "per_page": 16,
    "from": "voluptatem",
    "to": "iusto"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


json
 

Request      

GET api/project/consumptions

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Body Parameters

page   integer  optional    

nullable Example: 6

per_page   integer  optional    

nullable Example: 16

from   date  optional    

nullable Example: voluptatem

to   date  optional    

nullable Example: iusto

SMS

POST api/sms/messages

requires authentication

Example request:
curl --request POST \
    "https://sms.lamah.com/api/sms/messages" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"message\": \"ex\",
    \"sender\": \"perferendis\",
    \"payment_type\": \"esse\",
    \"receiver\": \"at\"
}"
const url = new URL(
    "https://sms.lamah.com/api/sms/messages"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "message": "ex",
    "sender": "perferendis",
    "payment_type": "esse",
    "receiver": "at"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


json
 

Request      

POST api/sms/messages

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Body Parameters

message   required  optional    

string Example: ex

sender   required  optional    

string Example: perferendis

payment_type   required  optional    

string [wallet, subscription] Example: esse

receiver   required  optional    

phone number Example: at

POST api/sms/messages/bulk

requires authentication

Example request:
curl --request POST \
    "https://sms.lamah.com/api/sms/messages/bulk" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"message\": \"sint\",
    \"sender\": \"asperiores\",
    \"payment_type\": \"quis\",
    \"receivers\": [
        \"sit\"
    ]
}"
const url = new URL(
    "https://sms.lamah.com/api/sms/messages/bulk"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "message": "sint",
    "sender": "asperiores",
    "payment_type": "quis",
    "receivers": [
        "sit"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


json
 

Request      

POST api/sms/messages/bulk

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Body Parameters

message   required  optional    

string Example: sint

sender   required  optional    

string Example: asperiores

payment_type   required  optional    

string [wallet, subscription] Example: quis

receivers   string[]  optional    

of phone numbers required

POST api/sms/messages/template

requires authentication

Example request:
curl --request POST \
    "https://sms.lamah.com/api/sms/messages/template" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"template_name\": \"possimus\",
    \"sender\": \"accusamus\",
    \"payment_type\": \"magnam\",
    \"receiver\": \"et\",
    \"params\": [
        \"in\"
    ],
    \"template_id\": \"non\"
}"
const url = new URL(
    "https://sms.lamah.com/api/sms/messages/template"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "template_name": "possimus",
    "sender": "accusamus",
    "payment_type": "magnam",
    "receiver": "et",
    "params": [
        "in"
    ],
    "template_id": "non"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


json
 

Request      

POST api/sms/messages/template

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Body Parameters

template_name   string     

Example: possimus

sender   required  optional    

string Example: accusamus

payment_type   required  optional    

string [wallet, subscription] Example: magnam

receiver   required  optional    

phone number Example: et

params   string[]     
template_id   required  optional    

string Example: non

POST api/sms/messages/contacts

requires authentication

Example request:
curl --request POST \
    "https://sms.lamah.com/api/sms/messages/contacts" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"message\": \"voluptas\",
    \"sender\": \"quia\",
    \"payment_type\": \"aut\",
    \"contact_group_id\": \"porro\"
}"
const url = new URL(
    "https://sms.lamah.com/api/sms/messages/contacts"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "message": "voluptas",
    "sender": "quia",
    "payment_type": "aut",
    "contact_group_id": "porro"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


json
 

Request      

POST api/sms/messages/contacts

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Body Parameters

message   required  optional    

string Example: voluptas

sender   required  optional    

string Example: quia

payment_type   required  optional    

string [wallet, subscription] Example: aut

contact_group_id   required  optional    

string uuid Example: porro

GET api/sms/messages/{message_id}

requires authentication

Example request:
curl --request GET \
    --get "https://sms.lamah.com/api/sms/messages/deserunt?message_id=et" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"message_id\": \"aacc077e-3c0e-3868-89a6-8b5d1385f2a3\"
}"
const url = new URL(
    "https://sms.lamah.com/api/sms/messages/deserunt"
);

const params = {
    "message_id": "et",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "message_id": "aacc077e-3c0e-3868-89a6-8b5d1385f2a3"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


json
 

Request      

GET api/sms/messages/{message_id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

URL Parameters

message_id   string     

The ID of the message. Example: deserunt

Query Parameters

message_id   string     

uuid Example: et

Body Parameters

message_id   string     

validation.uuid. Example: aacc077e-3c0e-3868-89a6-8b5d1385f2a3

GET api/sms/messages

requires authentication

Example request:
curl --request GET \
    --get "https://sms.lamah.com/api/sms/messages" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"page\": 9,
    \"per_page\": 15,
    \"from\": \"sequi\",
    \"to\": \"quis\"
}"
const url = new URL(
    "https://sms.lamah.com/api/sms/messages"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "page": 9,
    "per_page": 15,
    "from": "sequi",
    "to": "quis"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


json
 

Request      

GET api/sms/messages

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Body Parameters

page   integer  optional    

nullable Example: 9

per_page   integer  optional    

nullable Example: 15

from   date  optional    

nullable Example: sequi

to   date  optional    

nullable Example: quis