Skip to main content
Version: Latest

SDK Code Examples — CommunicationController

Base URL: https://{tenant}.shumoul.app · Token variable: $TOKEN (bash) / %TOKEN% (cmd) / token (JS/C#/Dart), obtained per §19 SDK Usage Guide.


1. POST /api/v1/Communication/Send/Email

Permission: Communications.SendEmail

cURL — Linux/macOS:

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Send/Email" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"recipient":{"type":0,"email":"customer@example.com","name":"Ahmed"},"subject":"Your Invoice","body":"<p>Please find attached...</p>","isHtml":true,"referenceType":"Invoice","referenceNumber":"INV-2026-00451"}'

cURL — Windows (cmd.exe):

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Send/Email" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json" ^
-d "{\"recipient\":{\"type\":0,\"email\":\"customer@example.com\",\"name\":\"Ahmed\"},\"subject\":\"Your Invoice\",\"body\":\"<p>Please find attached...</p>\",\"isHtml\":true,\"referenceType\":\"Invoice\",\"referenceNumber\":\"INV-2026-00451\"}"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/Communication/Send/Email", {
method: "POST",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" },
body: JSON.stringify({
"recipient": {
"type": 0,
"email": "customer@example.com",
"name": "Ahmed"
},
"subject": "Your Invoice",
"body": "<p>Please find attached...</p>",
"isHtml": true,
"referenceType": "Invoice",
"referenceNumber": "INV-2026-00451"
})
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.post(
"https://{tenant}.shumoul.app/api/v1/Communication/Send/Email",
{
"recipient": {
"type": 0,
"email": "customer@example.com",
"name": "Ahmed"
},
"subject": "Your Invoice",
"body": "<p>Please find attached...</p>",
"isHtml": true,
"referenceType": "Invoice",
"referenceNumber": "INV-2026-00451"
},
{ headers: { Authorization: `Bearer ${token}` } }
);

C# — HttpClient:

var client = httpClientFactory.CreateClient("Shumoul"); // BaseAddress = "https://{tenant}.shumoul.app"
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var payload = new { recipient = new { type = 0, email = "customer@example.com", name = "Ahmed" }, subject = "Your Invoice", body = "<p>Please find attached...</p>", isHtml = true, referenceType = "Invoice", referenceNumber = "INV-2026-00451" };
var response = await client.PostAsJsonAsync("/api/v1/Communication/Send/Email", payload);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.post(
"/api/v1/Communication/Send/Email",
data: {
"recipient": {
"type": 0,
"email": "customer@example.com",
"name": "Ahmed"
},
"subject": "Your Invoice",
"body": "<p>Please find attached...</p>",
"isHtml": true,
"referenceType": "Invoice",
"referenceNumber": "INV-2026-00451"
},
options: Options(headers: {"Authorization": "Bearer $token"}),
);

2. POST /api/v1/Communication/Send/WhatsApp

Permission: Communications.SendWhatsApp

cURL — Linux/macOS:

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Send/WhatsApp" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"recipient":{"type":0,"phone":"966501112222","name":"Ahmed","languageCode":"ar"},"eventKey":"InvoiceIssued","templateName":"send_document_invoice","data":{"customerName":"Ahmed","amount":"12500.00","invoiceNumber":"INV-2026-00451"},"referenceType":"Invoice","referenceNumber":"INV-2026-00451"}'

cURL — Windows (cmd.exe):

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Send/WhatsApp" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json" ^
-d "{\"recipient\":{\"type\":0,\"phone\":\"966501112222\",\"name\":\"Ahmed\",\"languageCode\":\"ar\"},\"eventKey\":\"InvoiceIssued\",\"templateName\":\"send_document_invoice\",\"data\":{\"customerName\":\"Ahmed\",\"amount\":\"12500.00\",\"invoiceNumber\":\"INV-2026-00451\"},\"referenceType\":\"Invoice\",\"referenceNumber\":\"INV-2026-00451\"}"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/Communication/Send/WhatsApp", {
method: "POST",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" },
body: JSON.stringify({
"recipient": {
"type": 0,
"phone": "966501112222",
"name": "Ahmed",
"languageCode": "ar"
},
"eventKey": "InvoiceIssued",
"templateName": "send_document_invoice",
"data": {
"customerName": "Ahmed",
"amount": "12500.00",
"invoiceNumber": "INV-2026-00451"
},
"referenceType": "Invoice",
"referenceNumber": "INV-2026-00451"
})
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.post(
"https://{tenant}.shumoul.app/api/v1/Communication/Send/WhatsApp",
{
"recipient": {
"type": 0,
"phone": "966501112222",
"name": "Ahmed",
"languageCode": "ar"
},
"eventKey": "InvoiceIssued",
"templateName": "send_document_invoice",
"data": {
"customerName": "Ahmed",
"amount": "12500.00",
"invoiceNumber": "INV-2026-00451"
},
"referenceType": "Invoice",
"referenceNumber": "INV-2026-00451"
},
{ headers: { Authorization: `Bearer ${token}` } }
);

C# — HttpClient:

var client = httpClientFactory.CreateClient("Shumoul"); // BaseAddress = "https://{tenant}.shumoul.app"
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var payload = new { recipient = new { type = 0, phone = "966501112222", name = "Ahmed", languageCode = "ar" }, eventKey = "InvoiceIssued", templateName = "send_document_invoice", data = new { customerName = "Ahmed", amount = "12500.00", invoiceNumber = "INV-2026-00451" }, referenceType = "Invoice", referenceNumber = "INV-2026-00451" };
var response = await client.PostAsJsonAsync("/api/v1/Communication/Send/WhatsApp", payload);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.post(
"/api/v1/Communication/Send/WhatsApp",
data: {
"recipient": {
"type": 0,
"phone": "966501112222",
"name": "Ahmed",
"languageCode": "ar"
},
"eventKey": "InvoiceIssued",
"templateName": "send_document_invoice",
"data": {
"customerName": "Ahmed",
"amount": "12500.00",
"invoiceNumber": "INV-2026-00451"
},
"referenceType": "Invoice",
"referenceNumber": "INV-2026-00451"
},
options: Options(headers: {"Authorization": "Bearer $token"}),
);

3. POST /api/v1/Communication/Send/Sms

Permission: Communications.SendSms

cURL — Linux/macOS:

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Send/Sms" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"recipient":{"type":0,"phone":"966501112222"},"messageText":"Your OTP is 482913","referenceType":"Otp"}'

cURL — Windows (cmd.exe):

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Send/Sms" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json" ^
-d "{\"recipient\":{\"type\":0,\"phone\":\"966501112222\"},\"messageText\":\"Your OTP is 482913\",\"referenceType\":\"Otp\"}"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/Communication/Send/Sms", {
method: "POST",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" },
body: JSON.stringify({
"recipient": {
"type": 0,
"phone": "966501112222"
},
"messageText": "Your OTP is 482913",
"referenceType": "Otp"
})
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.post(
"https://{tenant}.shumoul.app/api/v1/Communication/Send/Sms",
{
"recipient": {
"type": 0,
"phone": "966501112222"
},
"messageText": "Your OTP is 482913",
"referenceType": "Otp"
},
{ headers: { Authorization: `Bearer ${token}` } }
);

C# — HttpClient:

var client = httpClientFactory.CreateClient("Shumoul"); // BaseAddress = "https://{tenant}.shumoul.app"
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var payload = new { recipient = new { type = 0, phone = "966501112222" }, messageText = "Your OTP is 482913", referenceType = "Otp" };
var response = await client.PostAsJsonAsync("/api/v1/Communication/Send/Sms", payload);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.post(
"/api/v1/Communication/Send/Sms",
data: {
"recipient": {
"type": 0,
"phone": "966501112222"
},
"messageText": "Your OTP is 482913",
"referenceType": "Otp"
},
options: Options(headers: {"Authorization": "Bearer $token"}),
);

4. POST /api/v1/Communication/Send/Push

Permission: Communications.SendPush

cURL — Linux/macOS:

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Send/Push" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"recipient":{"type":0},"title":"Order Shipped","body":"Your order is on its way","eventKey":"OrderShipped"}'

cURL — Windows (cmd.exe):

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Send/Push" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json" ^
-d "{\"recipient\":{\"type\":0},\"title\":\"Order Shipped\",\"body\":\"Your order is on its way\",\"eventKey\":\"OrderShipped\"}"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/Communication/Send/Push", {
method: "POST",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" },
body: JSON.stringify({
"recipient": {
"type": 0
},
"title": "Order Shipped",
"body": "Your order is on its way",
"eventKey": "OrderShipped"
})
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.post(
"https://{tenant}.shumoul.app/api/v1/Communication/Send/Push",
{
"recipient": {
"type": 0
},
"title": "Order Shipped",
"body": "Your order is on its way",
"eventKey": "OrderShipped"
},
{ headers: { Authorization: `Bearer ${token}` } }
);

C# — HttpClient:

var client = httpClientFactory.CreateClient("Shumoul"); // BaseAddress = "https://{tenant}.shumoul.app"
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var payload = new { recipient = new { type = 0 }, title = "Order Shipped", body = "Your order is on its way", eventKey = "OrderShipped" };
var response = await client.PostAsJsonAsync("/api/v1/Communication/Send/Push", payload);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.post(
"/api/v1/Communication/Send/Push",
data: {
"recipient": {
"type": 0
},
"title": "Order Shipped",
"body": "Your order is on its way",
"eventKey": "OrderShipped"
},
options: Options(headers: {"Authorization": "Bearer $token"}),
);

5. POST /api/v1/Communication/Send/Notification

Permission: Communications.Send

cURL — Linux/macOS:

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Send/Notification" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"recipient":{"type":0},"eventKey":"PurchaseInvoicePosted","data":{"amount":"12500.00"}}'

cURL — Windows (cmd.exe):

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Send/Notification" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json" ^
-d "{\"recipient\":{\"type\":0},\"eventKey\":\"PurchaseInvoicePosted\",\"data\":{\"amount\":\"12500.00\"}}"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/Communication/Send/Notification", {
method: "POST",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" },
body: JSON.stringify({
"recipient": {
"type": 0
},
"eventKey": "PurchaseInvoicePosted",
"data": {
"amount": "12500.00"
}
})
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.post(
"https://{tenant}.shumoul.app/api/v1/Communication/Send/Notification",
{
"recipient": {
"type": 0
},
"eventKey": "PurchaseInvoicePosted",
"data": {
"amount": "12500.00"
}
},
{ headers: { Authorization: `Bearer ${token}` } }
);

C# — HttpClient:

var client = httpClientFactory.CreateClient("Shumoul"); // BaseAddress = "https://{tenant}.shumoul.app"
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var payload = new { recipient = new { type = 0 }, eventKey = "PurchaseInvoicePosted", data = new { amount = "12500.00" } };
var response = await client.PostAsJsonAsync("/api/v1/Communication/Send/Notification", payload);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.post(
"/api/v1/Communication/Send/Notification",
data: {
"recipient": {
"type": 0
},
"eventKey": "PurchaseInvoicePosted",
"data": {
"amount": "12500.00"
}
},
options: Options(headers: {"Authorization": "Bearer $token"}),
);

6. POST /api/v1/Communication/Send/Document

Permission: Communications.SendDocument

cURL — Linux/macOS:

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Send/Document" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"channel":2,"recipient":{"phone":"966501112222","languageCode":"ar"},"documentType":"Invoice","documentNumber":"INV-2026-00451","templateName":"send_document_invoice","data":{"amount":"12500.00"}}'

cURL — Windows (cmd.exe):

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Send/Document" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json" ^
-d "{\"channel\":2,\"recipient\":{\"phone\":\"966501112222\",\"languageCode\":\"ar\"},\"documentType\":\"Invoice\",\"documentNumber\":\"INV-2026-00451\",\"templateName\":\"send_document_invoice\",\"data\":{\"amount\":\"12500.00\"}}"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/Communication/Send/Document", {
method: "POST",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" },
body: JSON.stringify({
"channel": 2,
"recipient": {
"phone": "966501112222",
"languageCode": "ar"
},
"documentType": "Invoice",
"documentNumber": "INV-2026-00451",
"templateName": "send_document_invoice",
"data": {
"amount": "12500.00"
}
})
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.post(
"https://{tenant}.shumoul.app/api/v1/Communication/Send/Document",
{
"channel": 2,
"recipient": {
"phone": "966501112222",
"languageCode": "ar"
},
"documentType": "Invoice",
"documentNumber": "INV-2026-00451",
"templateName": "send_document_invoice",
"data": {
"amount": "12500.00"
}
},
{ headers: { Authorization: `Bearer ${token}` } }
);

C# — HttpClient:

var client = httpClientFactory.CreateClient("Shumoul"); // BaseAddress = "https://{tenant}.shumoul.app"
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var payload = new { channel = 2, recipient = new { phone = "966501112222", languageCode = "ar" }, documentType = "Invoice", documentNumber = "INV-2026-00451", templateName = "send_document_invoice", data = new { amount = "12500.00" } };
var response = await client.PostAsJsonAsync("/api/v1/Communication/Send/Document", payload);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.post(
"/api/v1/Communication/Send/Document",
data: {
"channel": 2,
"recipient": {
"phone": "966501112222",
"languageCode": "ar"
},
"documentType": "Invoice",
"documentNumber": "INV-2026-00451",
"templateName": "send_document_invoice",
"data": {
"amount": "12500.00"
}
},
options: Options(headers: {"Authorization": "Bearer $token"}),
);

7. POST /api/v1/Communication/Preview

Permission: Communications.Preview

cURL — Linux/macOS:

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Preview" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"channel":2,"recipient":{"phone":"966501112222","languageCode":"ar"},"documentType":"Invoice","documentNumber":"INV-2026-00451","templateName":"send_document_invoice","data":{"amount":"12500.00"}}'

cURL — Windows (cmd.exe):

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Preview" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json" ^
-d "{\"channel\":2,\"recipient\":{\"phone\":\"966501112222\",\"languageCode\":\"ar\"},\"documentType\":\"Invoice\",\"documentNumber\":\"INV-2026-00451\",\"templateName\":\"send_document_invoice\",\"data\":{\"amount\":\"12500.00\"}}"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/Communication/Preview", {
method: "POST",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" },
body: JSON.stringify({
"channel": 2,
"recipient": {
"phone": "966501112222",
"languageCode": "ar"
},
"documentType": "Invoice",
"documentNumber": "INV-2026-00451",
"templateName": "send_document_invoice",
"data": {
"amount": "12500.00"
}
})
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.post(
"https://{tenant}.shumoul.app/api/v1/Communication/Preview",
{
"channel": 2,
"recipient": {
"phone": "966501112222",
"languageCode": "ar"
},
"documentType": "Invoice",
"documentNumber": "INV-2026-00451",
"templateName": "send_document_invoice",
"data": {
"amount": "12500.00"
}
},
{ headers: { Authorization: `Bearer ${token}` } }
);

C# — HttpClient:

var client = httpClientFactory.CreateClient("Shumoul"); // BaseAddress = "https://{tenant}.shumoul.app"
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var payload = new { channel = 2, recipient = new { phone = "966501112222", languageCode = "ar" }, documentType = "Invoice", documentNumber = "INV-2026-00451", templateName = "send_document_invoice", data = new { amount = "12500.00" } };
var response = await client.PostAsJsonAsync("/api/v1/Communication/Preview", payload);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.post(
"/api/v1/Communication/Preview",
data: {
"channel": 2,
"recipient": {
"phone": "966501112222",
"languageCode": "ar"
},
"documentType": "Invoice",
"documentNumber": "INV-2026-00451",
"templateName": "send_document_invoice",
"data": {
"amount": "12500.00"
}
},
options: Options(headers: {"Authorization": "Bearer $token"}),
);

8. GET /api/v1/Communication/ValidateSettings/{channel}

Permission: Communications.ManageSettings

cURL — Linux/macOS:

curl -X GET "https://{tenant}.shumoul.app/api/v1/Communication/ValidateSettings/2" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"

cURL — Windows (cmd.exe):

curl -X GET "https://{tenant}.shumoul.app/api/v1/Communication/ValidateSettings/2" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/Communication/ValidateSettings/2", {
method: "GET",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" }
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.get("https://{tenant}.shumoul.app/api/v1/Communication/ValidateSettings/2", { headers: { Authorization: `Bearer ${token}` } });

C# — HttpClient:

var client = httpClientFactory.CreateClient("Shumoul"); // BaseAddress = "https://{tenant}.shumoul.app"
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var response = await client.GetAsync("/api/v1/Communication/ValidateSettings/2");
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.get(
"/api/v1/Communication/ValidateSettings/2",
options: Options(headers: {"Authorization": "Bearer $token"}),
);

9. GET /api/v1/Communication/ProviderInfo/Email

Permission: Communications.ManageSettings

cURL — Linux/macOS:

curl -X GET "https://{tenant}.shumoul.app/api/v1/Communication/ProviderInfo/Email" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"

cURL — Windows (cmd.exe):

curl -X GET "https://{tenant}.shumoul.app/api/v1/Communication/ProviderInfo/Email" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/Communication/ProviderInfo/Email", {
method: "GET",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" }
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.get("https://{tenant}.shumoul.app/api/v1/Communication/ProviderInfo/Email", { headers: { Authorization: `Bearer ${token}` } });

C# — HttpClient:

var client = httpClientFactory.CreateClient("Shumoul"); // BaseAddress = "https://{tenant}.shumoul.app"
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var response = await client.GetAsync("/api/v1/Communication/ProviderInfo/Email");
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.get(
"/api/v1/Communication/ProviderInfo/Email",
options: Options(headers: {"Authorization": "Bearer $token"}),
);

10. GET /api/v1/Communication/ProviderInfo/WhatsApp

Permission: Communications.ManageSettings

cURL — Linux/macOS:

curl -X GET "https://{tenant}.shumoul.app/api/v1/Communication/ProviderInfo/WhatsApp" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"

cURL — Windows (cmd.exe):

curl -X GET "https://{tenant}.shumoul.app/api/v1/Communication/ProviderInfo/WhatsApp" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/Communication/ProviderInfo/WhatsApp", {
method: "GET",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" }
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.get("https://{tenant}.shumoul.app/api/v1/Communication/ProviderInfo/WhatsApp", { headers: { Authorization: `Bearer ${token}` } });

C# — HttpClient:

var client = httpClientFactory.CreateClient("Shumoul"); // BaseAddress = "https://{tenant}.shumoul.app"
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var response = await client.GetAsync("/api/v1/Communication/ProviderInfo/WhatsApp");
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.get(
"/api/v1/Communication/ProviderInfo/WhatsApp",
options: Options(headers: {"Authorization": "Bearer $token"}),
);

11. POST /api/v1/Communication/Test/Email

Permission: Communications.TestEmail

cURL — Linux/macOS:

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Test/Email" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"toEmail":"admin@tenant.com","subject":"Shumoul Test Email"}'

cURL — Windows (cmd.exe):

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Test/Email" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json" ^
-d "{\"toEmail\":\"admin@tenant.com\",\"subject\":\"Shumoul Test Email\"}"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/Communication/Test/Email", {
method: "POST",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" },
body: JSON.stringify({
"toEmail": "admin@tenant.com",
"subject": "Shumoul Test Email"
})
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.post(
"https://{tenant}.shumoul.app/api/v1/Communication/Test/Email",
{
"toEmail": "admin@tenant.com",
"subject": "Shumoul Test Email"
},
{ headers: { Authorization: `Bearer ${token}` } }
);

C# — HttpClient:

var client = httpClientFactory.CreateClient("Shumoul"); // BaseAddress = "https://{tenant}.shumoul.app"
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var payload = new { toEmail = "admin@tenant.com", subject = "Shumoul Test Email" };
var response = await client.PostAsJsonAsync("/api/v1/Communication/Test/Email", payload);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.post(
"/api/v1/Communication/Test/Email",
data: {
"toEmail": "admin@tenant.com",
"subject": "Shumoul Test Email"
},
options: Options(headers: {"Authorization": "Bearer $token"}),
);

12. POST /api/v1/Communication/Test/WhatsApp

Permission: Communications.TestWhatsApp

cURL — Linux/macOS:

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Test/WhatsApp" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"toPhone":"966501112222","templateName":"hello_world","languageCode":"ar"}'

cURL — Windows (cmd.exe):

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Test/WhatsApp" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json" ^
-d "{\"toPhone\":\"966501112222\",\"templateName\":\"hello_world\",\"languageCode\":\"ar\"}"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/Communication/Test/WhatsApp", {
method: "POST",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" },
body: JSON.stringify({
"toPhone": "966501112222",
"templateName": "hello_world",
"languageCode": "ar"
})
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.post(
"https://{tenant}.shumoul.app/api/v1/Communication/Test/WhatsApp",
{
"toPhone": "966501112222",
"templateName": "hello_world",
"languageCode": "ar"
},
{ headers: { Authorization: `Bearer ${token}` } }
);

C# — HttpClient:

var client = httpClientFactory.CreateClient("Shumoul"); // BaseAddress = "https://{tenant}.shumoul.app"
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var payload = new { toPhone = "966501112222", templateName = "hello_world", languageCode = "ar" };
var response = await client.PostAsJsonAsync("/api/v1/Communication/Test/WhatsApp", payload);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.post(
"/api/v1/Communication/Test/WhatsApp",
data: {
"toPhone": "966501112222",
"templateName": "hello_world",
"languageCode": "ar"
},
options: Options(headers: {"Authorization": "Bearer $token"}),
);