Skip to main content
Version: Latest

SDK Code Examples — WhatsAppSavedReplyController

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/whatsapp/saved-replies/GetSavedReplies

Permission: WhatsAppInbox.SavedReplies.View

cURL — Linux/macOS:

curl -X GET "https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/GetSavedReplies?search=refund&includePersonal=true&includeShared=true" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"

cURL — Windows (cmd.exe):

curl -X GET "https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/GetSavedReplies?search=refund&includePersonal=true&includeShared=true" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/GetSavedReplies?search=refund&includePersonal=true&includeShared=true", {
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/whatsapp/saved-replies/GetSavedReplies?search=refund&includePersonal=true&includeShared=true", { 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/whatsapp/saved-replies/GetSavedReplies?search=refund&includePersonal=true&includeShared=true");
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.get(
"/api/v1/whatsapp/saved-replies/GetSavedReplies?search=refund&includePersonal=true&includeShared=true",
options: Options(headers: {"Authorization": "Bearer $token"}),
);

2. GET /api/v1/whatsapp/saved-replies/GetDetails/{id}

Permission: WhatsAppInbox.SavedReplies.View

cURL — Linux/macOS:

curl -X GET "https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/GetDetails/s1a2b3c4-0000-0000-0000-000000000001" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"

cURL — Windows (cmd.exe):

curl -X GET "https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/GetDetails/s1a2b3c4-0000-0000-0000-000000000001" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json"

JavaScript — fetch():

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

Flutter — Dio:

final response = await dio.get(
"/api/v1/whatsapp/saved-replies/GetDetails/s1a2b3c4-0000-0000-0000-000000000001",
options: Options(headers: {"Authorization": "Bearer $token"}),
);

3. GET /api/v1/whatsapp/saved-replies/GetEdit/{id}

Permission: WhatsAppInbox.SavedReplies.Edit

cURL — Linux/macOS:

curl -X GET "https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/GetEdit/s1a2b3c4-0000-0000-0000-000000000001" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"

cURL — Windows (cmd.exe):

curl -X GET "https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/GetEdit/s1a2b3c4-0000-0000-0000-000000000001" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json"

JavaScript — fetch():

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

Flutter — Dio:

final response = await dio.get(
"/api/v1/whatsapp/saved-replies/GetEdit/s1a2b3c4-0000-0000-0000-000000000001",
options: Options(headers: {"Authorization": "Bearer $token"}),
);

4. POST /api/v1/whatsapp/saved-replies/Create

Permission: WhatsAppInbox.SavedReplies.Create

cURL — Linux/macOS:

curl -X POST "https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Create" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"title":"رد الاسترجاع","fTitle":"Refund Reply","body":"تم استرجاع مبلغكم...","shortcut":"/refund","category":"Billing","isShared":true,"isActive":true}'

cURL — Windows (cmd.exe):

curl -X POST "https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Create" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json" ^
-d "{\"title\":\"رد الاسترجاع\",\"fTitle\":\"Refund Reply\",\"body\":\"تم استرجاع مبلغكم...\",\"shortcut\":\"/refund\",\"category\":\"Billing\",\"isShared\":true,\"isActive\":true}"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Create", {
method: "POST",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" },
body: JSON.stringify({
"title": "رد الاسترجاع",
"fTitle": "Refund Reply",
"body": "تم استرجاع مبلغكم...",
"shortcut": "/refund",
"category": "Billing",
"isShared": true,
"isActive": true
})
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.post(
"https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Create",
{
"title": "رد الاسترجاع",
"fTitle": "Refund Reply",
"body": "تم استرجاع مبلغكم...",
"shortcut": "/refund",
"category": "Billing",
"isShared": true,
"isActive": true
},
{ 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 { title = "رد الاسترجاع", fTitle = "Refund Reply", body = "تم استرجاع مبلغكم...", shortcut = "/refund", category = "Billing", isShared = true, isActive = true };
var response = await client.PostAsJsonAsync("/api/v1/whatsapp/saved-replies/Create", payload);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.post(
"/api/v1/whatsapp/saved-replies/Create",
data: {
"title": "رد الاسترجاع",
"fTitle": "Refund Reply",
"body": "تم استرجاع مبلغكم...",
"shortcut": "/refund",
"category": "Billing",
"isShared": true,
"isActive": true
},
options: Options(headers: {"Authorization": "Bearer $token"}),
);

5. PUT /api/v1/whatsapp/saved-replies/Update/{id}

Permission: WhatsAppInbox.SavedReplies.Edit

cURL — Linux/macOS:

curl -X PUT "https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Update/s1a2b3c4-0000-0000-0000-000000000001" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"id":"s1a2b3c4-0000-0000-0000-000000000001","title":"رد الاسترجاع","fTitle":"Refund Reply (Updated)","body":"تم استرجاع مبلغكم بالكامل...","shortcut":"/refund","category":"Billing","isShared":true,"isActive":true}'

cURL — Windows (cmd.exe):

curl -X PUT "https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Update/s1a2b3c4-0000-0000-0000-000000000001" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json" ^
-d "{\"id\":\"s1a2b3c4-0000-0000-0000-000000000001\",\"title\":\"رد الاسترجاع\",\"fTitle\":\"Refund Reply (Updated)\",\"body\":\"تم استرجاع مبلغكم بالكامل...\",\"shortcut\":\"/refund\",\"category\":\"Billing\",\"isShared\":true,\"isActive\":true}"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Update/s1a2b3c4-0000-0000-0000-000000000001", {
method: "PUT",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" },
body: JSON.stringify({
"id": "s1a2b3c4-0000-0000-0000-000000000001",
"title": "رد الاسترجاع",
"fTitle": "Refund Reply (Updated)",
"body": "تم استرجاع مبلغكم بالكامل...",
"shortcut": "/refund",
"category": "Billing",
"isShared": true,
"isActive": true
})
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.put(
"https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Update/s1a2b3c4-0000-0000-0000-000000000001",
{
"id": "s1a2b3c4-0000-0000-0000-000000000001",
"title": "رد الاسترجاع",
"fTitle": "Refund Reply (Updated)",
"body": "تم استرجاع مبلغكم بالكامل...",
"shortcut": "/refund",
"category": "Billing",
"isShared": true,
"isActive": true
},
{ 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 { id = "s1a2b3c4-0000-0000-0000-000000000001", title = "رد الاسترجاع", fTitle = "Refund Reply (Updated)", body = "تم استرجاع مبلغكم بالكامل...", shortcut = "/refund", category = "Billing", isShared = true, isActive = true };
var response = await client.PutAsJsonAsync("/api/v1/whatsapp/saved-replies/Update/s1a2b3c4-0000-0000-0000-000000000001", payload);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.put(
"/api/v1/whatsapp/saved-replies/Update/s1a2b3c4-0000-0000-0000-000000000001",
data: {
"id": "s1a2b3c4-0000-0000-0000-000000000001",
"title": "رد الاسترجاع",
"fTitle": "Refund Reply (Updated)",
"body": "تم استرجاع مبلغكم بالكامل...",
"shortcut": "/refund",
"category": "Billing",
"isShared": true,
"isActive": true
},
options: Options(headers: {"Authorization": "Bearer $token"}),
);

6. DELETE /api/v1/whatsapp/saved-replies/Delete/{id}

Permission: WhatsAppInbox.SavedReplies.Delete

cURL — Linux/macOS:

curl -X DELETE "https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Delete/s1a2b3c4-0000-0000-0000-000000000001" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"

cURL — Windows (cmd.exe):

curl -X DELETE "https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Delete/s1a2b3c4-0000-0000-0000-000000000001" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Delete/s1a2b3c4-0000-0000-0000-000000000001", {
method: "DELETE",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" }
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.delete("https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Delete/s1a2b3c4-0000-0000-0000-000000000001", { 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.DeleteAsync("/api/v1/whatsapp/saved-replies/Delete/s1a2b3c4-0000-0000-0000-000000000001");
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.delete(
"/api/v1/whatsapp/saved-replies/Delete/s1a2b3c4-0000-0000-0000-000000000001",
options: Options(headers: {"Authorization": "Bearer $token"}),
);

7. PUT /api/v1/whatsapp/saved-replies/Restore/{id}

Permission: WhatsAppInbox.SavedReplies.Delete

cURL — Linux/macOS:

curl -X PUT "https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Restore/s1a2b3c4-0000-0000-0000-000000000001" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"

cURL — Windows (cmd.exe):

curl -X PUT "https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Restore/s1a2b3c4-0000-0000-0000-000000000001" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Restore/s1a2b3c4-0000-0000-0000-000000000001", {
method: "PUT",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" }
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.put("https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Restore/s1a2b3c4-0000-0000-0000-000000000001", { 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.PutAsync("/api/v1/whatsapp/saved-replies/Restore/s1a2b3c4-0000-0000-0000-000000000001");
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.put(
"/api/v1/whatsapp/saved-replies/Restore/s1a2b3c4-0000-0000-0000-000000000001",
options: Options(headers: {"Authorization": "Bearer $token"}),
);

8. PUT /api/v1/whatsapp/saved-replies/Activate/{id}

Permission: WhatsAppInbox.SavedReplies.Edit

cURL — Linux/macOS:

curl -X PUT "https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Activate/s1a2b3c4-0000-0000-0000-000000000001" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"

cURL — Windows (cmd.exe):

curl -X PUT "https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Activate/s1a2b3c4-0000-0000-0000-000000000001" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Activate/s1a2b3c4-0000-0000-0000-000000000001", {
method: "PUT",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" }
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.put("https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Activate/s1a2b3c4-0000-0000-0000-000000000001", { 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.PutAsync("/api/v1/whatsapp/saved-replies/Activate/s1a2b3c4-0000-0000-0000-000000000001");
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.put(
"/api/v1/whatsapp/saved-replies/Activate/s1a2b3c4-0000-0000-0000-000000000001",
options: Options(headers: {"Authorization": "Bearer $token"}),
);

9. PUT /api/v1/whatsapp/saved-replies/Deactivate/{id}

Permission: WhatsAppInbox.SavedReplies.Edit

cURL — Linux/macOS:

curl -X PUT "https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Deactivate/s1a2b3c4-0000-0000-0000-000000000001" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"

cURL — Windows (cmd.exe):

curl -X PUT "https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Deactivate/s1a2b3c4-0000-0000-0000-000000000001" ^
-H "Authorization: Bearer %TOKEN%" ^
-H "Content-Type: application/json"

JavaScript — fetch():

const response = await fetch("https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Deactivate/s1a2b3c4-0000-0000-0000-000000000001", {
method: "PUT",
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" }
});
const result = await response.json();

JavaScript — Axios:

const { data } = await axios.put("https://{tenant}.shumoul.app/api/v1/whatsapp/saved-replies/Deactivate/s1a2b3c4-0000-0000-0000-000000000001", { 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.PutAsync("/api/v1/whatsapp/saved-replies/Deactivate/s1a2b3c4-0000-0000-0000-000000000001");
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<Result<object>>();

Flutter — Dio:

final response = await dio.put(
"/api/v1/whatsapp/saved-replies/Deactivate/s1a2b3c4-0000-0000-0000-000000000001",
options: Options(headers: {"Authorization": "Bearer $token"}),
);