Skip to main content
Version: Latest

SDK Code Examples — CommunicationDiagnosticsController

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


1. GET /api/v1/Communication/Health

Permission: Communications.Health

cURL — Linux/macOS:

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

cURL — Windows (cmd.exe):

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

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/Communication/Health", {
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/Health", { 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/Health");
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

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

2. POST /api/v1/Communication/SmokeTest

Permission: Communications.SmokeTest

cURL — Linux/macOS:

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/SmokeTest" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"toEmail":"qa@tenant.com","languageCode":"ar","testType":1}'

cURL — Windows (cmd.exe):

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/SmokeTest" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json" ^
-d "{\"toEmail\":\"qa@tenant.com\",\"languageCode\":\"ar\",\"testType\":1}"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/Communication/SmokeTest", {
method: "POST",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" },
body: JSON.stringify({
"toEmail": "qa@tenant.com",
"languageCode": "ar",
"testType": 1
})
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.post(
"https://{tenant}.shumoul.app/api/v1/Communication/SmokeTest",
{
"toEmail": "qa@tenant.com",
"languageCode": "ar",
"testType": 1
},
{ 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 = "qa@tenant.com", languageCode = "ar", testType = 1 };
var response = await client.PostAsJsonAsync("/api/v1/Communication/SmokeTest", payload);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.post(
"/api/v1/Communication/SmokeTest",
data: {
"toEmail": "qa@tenant.com",
"languageCode": "ar",
"testType": 1
},
options: Options(headers: {"Authorization": "Bearer $token"}),
);

3. POST /api/v1/Communication/SmokeTest/WhatsApp

Permission: Communications.SmokeTest

cURL — Linux/macOS:

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

cURL — Windows (cmd.exe):

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

JavaScript — fetch():

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

JavaScript — Axios:

const { data } = await axios.post(
"https://{tenant}.shumoul.app/api/v1/Communication/SmokeTest/WhatsApp",
{
"toPhone": "966501112222",
"languageCode": "ar",
"testType": 6
},
{ 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", languageCode = "ar", testType = 6 };
var response = await client.PostAsJsonAsync("/api/v1/Communication/SmokeTest/WhatsApp", payload);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

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

4. POST /api/v1/Communication/Diagnostics/Providers

Permission: Communications.Diagnostics

cURL — Linux/macOS:

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Diagnostics/Providers?channel=WhatsApp&templateBaseName=send_document&languageCode=ar" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"

cURL — Windows (cmd.exe):

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Diagnostics/Providers?channel=WhatsApp&templateBaseName=send_document&languageCode=ar" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/Communication/Diagnostics/Providers?channel=WhatsApp&templateBaseName=send_document&languageCode=ar", {
method: "POST",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" }
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.post("https://{tenant}.shumoul.app/api/v1/Communication/Diagnostics/Providers?channel=WhatsApp&templateBaseName=send_document&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 response = await client.PostAsync("/api/v1/Communication/Diagnostics/Providers?channel=WhatsApp&templateBaseName=send_document&languageCode=ar");
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.post(
"/api/v1/Communication/Diagnostics/Providers?channel=WhatsApp&templateBaseName=send_document&languageCode=ar",
options: Options(headers: {"Authorization": "Bearer $token"}),
);

5. GET /api/v1/Communication/Diagnostics/Email

Permission: Communications.Diagnostics

cURL — Linux/macOS:

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

cURL — Windows (cmd.exe):

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

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/Communication/Diagnostics/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/Diagnostics/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/Diagnostics/Email");
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

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

6. GET /api/v1/Communication/Diagnostics/WhatsApp

Permission: Communications.Diagnostics

cURL — Linux/macOS:

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

cURL — Windows (cmd.exe):

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

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/Communication/Diagnostics/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/Diagnostics/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/Diagnostics/WhatsApp");
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

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

7. POST /api/v1/Communication/Diagnostics/PrintPreview

Permission: Communications.Diagnostics

cURL — Linux/macOS:

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Diagnostics/PrintPreview" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"recipientPhone":"966501112222","languageCode":"ar","channel":2,"documentType":"Invoice","documentNumber":"INV-2026-00451"}'

cURL — Windows (cmd.exe):

curl -X POST "https://{tenant}.shumoul.app/api/v1/Communication/Diagnostics/PrintPreview" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json" ^
-d "{\"recipientPhone\":\"966501112222\",\"languageCode\":\"ar\",\"channel\":2,\"documentType\":\"Invoice\",\"documentNumber\":\"INV-2026-00451\"}"

JavaScript — fetch():

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

JavaScript — Axios:

const { data } = await axios.post(
"https://{tenant}.shumoul.app/api/v1/Communication/Diagnostics/PrintPreview",
{
"recipientPhone": "966501112222",
"languageCode": "ar",
"channel": 2,
"documentType": "Invoice",
"documentNumber": "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 { recipientPhone = "966501112222", languageCode = "ar", channel = 2, documentType = "Invoice", documentNumber = "INV-2026-00451" };
var response = await client.PostAsJsonAsync("/api/v1/Communication/Diagnostics/PrintPreview", payload);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.post(
"/api/v1/Communication/Diagnostics/PrintPreview",
data: {
"recipientPhone": "966501112222",
"languageCode": "ar",
"channel": 2,
"documentType": "Invoice",
"documentNumber": "INV-2026-00451"
},
options: Options(headers: {"Authorization": "Bearer $token"}),
);