Developer API Documentation
Integrate official Meta WhatsApp Business API messaging into any custom application (Laravel, React, Node.js, Python, Flutter, Mobile Apps, or Custom ERPs).
Base URL & Authentication
All requests require HTTPS and bearer token authorization. Pass your API Key in the HTTP Authorization header.
POST /api/v1/send-message.php HTTP/1.1 Host: app.rsaltek.com Authorization: Bearer YOUR_TSKIN_API_KEY Content-Type: application/json
API Endpoints
Use this endpoint to trigger official approved Meta WhatsApp templates (e.g., order updates, verification OTPs, appointment reminders).
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| phone | string | Yes | Destination phone with country code (e.g. 966500000000). |
| message_type | string | Yes | Must be set to "template". |
| template_name | string | Yes | Approved Meta template slug. |
| language | string | Yes | Language code (e.g. "en", "en_US"). |
| params | array | Optional | Dynamic template variables array ({{1}}, {{2}}, etc.). |
Example Request Payload
{
"phone": "966500000000",
"message_type": "template",
"template_name": "order_update_notice",
"language": "en",
"params": [
"10024",
"Leather Handbag",
"250 SAR"
]
}
Success Response (200 OK)
{
"status": "success",
"message_id": "wamid.HBgLOTY2...",
"recipient": "966500000000",
"type": "template"
}
Send plain unstructured text messages within an open 24-hour customer service window.
{
"phone": "966500000000",
"message_type": "text",
"message": "Hello! How can we assist you with your order today?"
}
Code Examples
<?php
$apiKey = "YOUR_TSKIN_API_KEY";
$url = "https://app.rsaltek.com/api/v1/send-message.php";
$payload = [
"phone" => "966500000000",
"message_type" => "template",
"template_name" => "order_update_notice",
"language" => "en",
"params" => ["10024", "Leather Handbag", "250 SAR"]
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($payload, JSON_UNESCAPED_UNICODE),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer {$apiKey}",
"Content-Type: application/json"
],
CURLOPT_RETURNTRANSFER => true
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
const axios = require('axios');
axios.post('https://app.rsaltek.com/api/v1/send-message.php', {
phone: '966500000000',
message_type: 'template',
template_name: 'order_update_notice',
language: 'en',
params: ['10024', 'Leather Handbag', '250 SAR']
}, {
headers: {
'Authorization': 'Bearer YOUR_TSKIN_API_KEY',
'Content-Type': 'application/json'
}
})
.then(res => console.log(res.data))
.catch(err => console.error(err.response ? err.response.data : err.message));
import requests
url = "https://app.rsaltek.com/api/v1/send-message.php"
headers = {
"Authorization": "Bearer YOUR_TSKIN_API_KEY",
"Content-Type": "application/json"
}
payload = {
"phone": "966500000000",
"message_type": "template",
"template_name": "order_update_notice",
"language": "en",
"params": ["10024", "Leather Handbag", "250 SAR"]
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Receiving Inbound Webhooks
When a customer replies on WhatsApp, Rsaltek forwards the event payload to your registered Webhook URL:
{
"event": "message_received",
"from_phone": "966500000000",
"message_type": "text",
"message_text": "Thank you so much! I received my package.",
"timestamp": 1770000000
}
HTTP Status Codes
| Code | Status | Meaning & Resolution |
|---|---|---|
| 200 | OK | Message accepted and dispatched to Meta Graph API. |
| 400 | Bad Request | Missing body parameter, malformed phone format, or invalid JSON payload. |
| 401 | Unauthorized | Invalid API Key or missing Authorization header token. |
| 403 | Forbidden | Account disabled, domain blocked, or subscription plan expired. |
| 500 | Internal Error | Meta Graph API error response or internal system exception. |