Welcome to Mora WhatsApp API
Powerful WhatsApp messaging integration
The Mora WhatsApp API enables you to send template messages and OTP authentication messages to WhatsApp users.
Base URL: https://app.morawhats.com/api
Authentication
All requests require an API key. Include api_key in your request body.
⚠️ Security: Keep your API key secure. Never expose it in client-side code.
Send Template Message
Send WhatsApp messages using predefined templates with dynamic variables and file attachments.
POST/api/send
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | string | Required | Your API key |
template_name | string | Required | Template name |
mobile | string | Required | Mobile with country code |
variables[n] | array | Optional | Template variables |
file | file | Optional | File attachment |
Code Examples
curl -X POST 'https://app.morawhats.com/api/send' \ -F 'api_key=YOUR_API_KEY' \ -F 'template_name=more_company' \ -F 'mobile=201069013141' \ -F 'variables[0]=ahmed' \ -F 'variables[1]=samir' \ -F 'file=@/path/to/file'
<?php
$ch = curl_init();
$data = [
'api_key' => 'YOUR_API_KEY',
'template_name' => 'more_company',
'mobile' => '201069013141',
'variables[0]' => 'ahmed',
'variables[1]' => 'samir'
];
if (file_exists('/path/to/file')) {
$data['file'] = new CURLFile('/path/to/file');
}
curl_setopt_array($ch, [
CURLOPT_URL => 'https://app.morawhats.com/api/send',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $data
]);
$response = curl_exec($ch);
curl_close($ch);
?>
import requests
url = 'https://app.morawhats.com/api/send'
data = {
'api_key': 'YOUR_API_KEY',
'template_name': 'more_company',
'mobile': '201069013141',
'variables[0]': 'ahmed',
'variables[1]': 'samir'
}
files = {'file': open('/path/to/file', 'rb')}
response = requests.post(url, data=data, files=files)
print(response.text)
const formData = new FormData();
formData.append('api_key', 'YOUR_API_KEY');
formData.append('template_name', 'more_company');
formData.append('mobile', '201069013141');
formData.append('variables[0]', 'ahmed');
formData.append('variables[1]', 'samir');
formData.append('file', fileInput.files[0]);
fetch('https://app.morawhats.com/api/send', {
method: 'POST',
body: formData
})
.then(res => res.json())
.then(data => console.log(data));
using System.Net.Http;
using System.IO;
var client = new HttpClient();
var form = new MultipartFormDataContent();
form.Add(new StringContent("YOUR_API_KEY"), "api_key");
form.Add(new StringContent("more_company"), "template_name");
form.Add(new StringContent("201069013141"), "mobile");
form.Add(new StringContent("ahmed"), "variables[0]");
form.Add(new StringContent("samir"), "variables[1]");
if (File.Exists("path/to/file")) {
var bytes = File.ReadAllBytes("path/to/file");
form.Add(new ByteArrayContent(bytes), "file", "file.ext");
}
var response = await client.PostAsync(
"https://app.morawhats.com/api/send", form);
var result = await response.Content.ReadAsStringAsync();
Imports System.Net.Http
Imports System.IO
Dim client As New HttpClient()
Dim form As New MultipartFormDataContent()
form.Add(New StringContent("YOUR_API_KEY"), "api_key")
form.Add(New StringContent("more_company"), "template_name")
form.Add(New StringContent("201069013141"), "mobile")
form.Add(New StringContent("ahmed"), "variables(0)")
form.Add(New StringContent("samir"), "variables(1)")
If File.Exists("path/to/file") Then
Dim bytes = File.ReadAllBytes("path/to/file")
form.Add(New ByteArrayContent(bytes), "file", "file.ext")
End If
Dim response = Await client.PostAsync(
"https://app.morawhats.com/api/send", form)
Dim result = Await response.Content.ReadAsStringAsync()
Send OTP Message
Send one-time password authentication messages.
POST/api/sendotp
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | string | Required | Your API key |
mobile | string | Required | Mobile with country code |
template_name | string | Required | OTP template name |
message | string | Required | OTP code |
Code Examples
curl -X POST 'https://app.morawhats.com/api/sendotp' \ -F 'api_key=YOUR_API_KEY' \ -F 'mobile=201069013141' \ -F 'template_name=test_auth1185' \ -F 'message=194205'
<?php
$ch = curl_init();
$data = [
'api_key' => 'YOUR_API_KEY',
'mobile' => '201069013141',
'template_name' => 'test_auth1185',
'message' => '194205'
];
curl_setopt_array($ch, [
CURLOPT_URL => 'https://app.morawhats.com/api/sendotp',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $data
]);
$response = curl_exec($ch);
curl_close($ch);
?>
import requests
url = 'https://app.morawhats.com/api/sendotp'
data = {
'api_key': 'YOUR_API_KEY',
'mobile': '201069013141',
'template_name': 'test_auth1185',
'message': '194205'
}
response = requests.post(url, data=data)
print(response.text)
const formData = new FormData();
formData.append('api_key', 'YOUR_API_KEY');
formData.append('mobile', '201069013141');
formData.append('template_name', 'test_auth1185');
formData.append('message', '194205');
fetch('https://app.morawhats.com/api/sendotp', {
method: 'POST',
body: formData
})
.then(res => res.json())
.then(data => console.log(data));
using System.Net.Http;
var client = new HttpClient();
var form = new MultipartFormDataContent();
form.Add(new StringContent("YOUR_API_KEY"), "api_key");
form.Add(new StringContent("201069013141"), "mobile");
form.Add(new StringContent("test_auth1185"), "template_name");
form.Add(new StringContent("194205"), "message");
var response = await client.PostAsync(
"https://app.morawhats.com/api/sendotp", form);
var result = await response.Content.ReadAsStringAsync();
Imports System.Net.Http
Dim client As New HttpClient()
Dim form As New MultipartFormDataContent()
form.Add(New StringContent("YOUR_API_KEY"), "api_key")
form.Add(New StringContent("201069013141"), "mobile")
form.Add(New StringContent("test_auth1185"), "template_name")
form.Add(New StringContent("194205"), "message")
Dim response = Await client.PostAsync(
"https://app.morawhats.com/api/sendotp", form)
Dim result = Await response.Content.ReadAsStringAsync()
Error Handling
Standard HTTP status codes indicate success or failure.
| Code | Meaning | Description |
|---|---|---|
200 | Success | Request completed successfully |
400 | Bad Request | Invalid parameters |
401 | Unauthorized | Invalid API key |
429 | Rate Limited | Too many requests |
500 | Server Error | Internal error |
💡 Best Practices:
- Implement exponential backoff for retries
- Cache template data when possible
- Monitor API usage regularly
Need Help?
Our support team is ready to assist with your integration.