Si vous avez déjà utilisé l'API Cloud WhatsApp, vous connaissez déjà la nôtre. Même chemin, même corps JSON, même authentification Bearer.
01Démarrage rapide
Trois éléments pour envoyer votre premier message: l'URL de base, une clé d'appareil et le point de terminaison.
Base URL
https://api.smartsybox.com
Authentication
Authorization: Bearer <YOUR_DEVICE_KEY>
Content type
application/json
Point de terminaison
POST
/v26.0/{phone-number-id}/messages
Le segment de version est accepté sous toute forme v (v26.0, v1.0, …). Le {phone-number-id} est l'identifiant de votre numéro WhatsApp.
02Envoyez votre premier message
Un message texte simple. Le corps est le charge utile standard de l'API Cloud — nous le transmettons tel quel.
cURL
curl -X POST https://api.smartsybox.com/v26.0/PHONE_NUMBER_ID/messages \
-H "Authorization: Bearer YOUR_DEVICE_KEY" \
-H "Content-Type: application/json" \
-d '{
"messaging_product": "whatsapp",
"to": "15551234567",
"type": "text",
"text": { "body": "Hello from SyBox 👋" }
}'
C# · HttpClient
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", "YOUR_DEVICE_KEY");
string json = @"{
""messaging_product"": ""whatsapp"",
""to"": ""15551234567"",
""type"": ""text"",
""text"": { ""body"": ""Hello from SyBox"" }
}";
var res = await http.PostAsync(
"https://api.smartsybox.com/v26.0/PHONE_NUMBER_ID/messages",
new StringContent(json, Encoding.UTF8, "application/json"));
Console.WriteLine(await res.Content.ReadAsStringAsync());
La réponse
Vous recevez exactement ce que Meta renvoie, avec le même statut HTTP.
200 OK · application/json
{
"messaging_product": "whatsapp",
"contacts": [{ "input": "15551234567", "wa_id": "15551234567" }],
"messages": [{ "id": "wamid.HBgLMTU1NTEyMzQ1NjcVAgARGBI…" }]
}
04Affichez vos données à côté de la conversation
À l'ouverture d'une conversation, SyBox appelle VOTRE point de terminaison et affiche votre réponse juste à côté du chat — commandes, solde, tickets du client. Nous envoyons le téléphone du client, ou son e-mail pour une conversation par e-mail.
Request · SyBox → your endpoint
POST YOUR_ERP_URL
Authorization: Bearer YOUR_ERP_KEY
X-Sybox-Action: lookup
# body: { "data": "<json string>" } — the decoded "data":
{
"phone": "15551234567",
"email": "customer@example.com",
"ref": ""
}
Your reply · application/json
{
"renderAs": "table",
"content": [
{ "Order": "#10432", "Status": "Shipped", "Total": "1,250 MAD" }
]
}
renderAs
Définissez renderAs pour indiquer à SyBox comment afficher vos données — l'une de :
table
Rows & columns. content = an array of flat objects (or { rows: [ … ] }). Object keys become the column headers.
cards · kpi
Compact tiles (a balance, an order count). content = an array of { label, value } (or { cards: [ … ] }).
feed · list · thread
A timeline of rich cards. content = an array of { title, text, date, tags, media:[{ type, url, name }] }.
message
A single message-style card (one record laid out as a note).
html
Your own trusted HTML — content = a string. Use only for markup you generate yourself.
sections
Several blocks at once: content = { sections: [ { title, renderAs, content } ] } — mix a table + cards + a feed in one reply.
json
The default when renderAs is omitted — SyBox pretty-prints your content as-is.
Ajoutez un sybox_ref à une ligne de tableau ou une carte pour la rendre cliquable — SyBox vous rappelle avec ce ref afin que vous renvoyiez le détail de cet enregistrement.
Nous envoyons le téléphone et l'e-mail — l'un peut être vide ; faites la correspondance avec celui qui identifie le client dans votre système, et répondez avec { renderAs, content }.
05Créer un dossier depuis votre propre système
C'est la route utilisée par un ERP ou système comptable pour ouvrir un ticket ou dossier dans SyBox CRM.
cURL
curl -X POST "https://api.smartsybox.com/v1/case" \
-H "Authorization: Bearer $SYBOX_CASE_KEY" \
-H "Content-Type: application/json" \
-d '{
"customer_unique_id": "CUST-10432",
"header": "Screen replacement not delivered",
"description": "Paid on 12 Aug, promised in 3 days, still nothing.",
"ext_ref": "TICKET-99817"
}'
Les champs
customer_unique_id
Votre propre identifiant client.
header / description
Au moins un champ est requis.
ext_ref
Votre numéro de ticket.
Le client doit déjà exister.
Utilisez une clé de type 'case'.