Meta WhatsApp Cloud API kullandıysanız, bizimkini zaten biliyorsunuzdur. Aynı yol, aynı JSON gövdesi, aynı Bearer yetkilendirmesi.
02İlk mesajınızı gönderin
Düz metin mesajı. Gövde standart Cloud API verisidir.
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());
Yanıt
Meta'nın döndürdüğü yanıtı aynı HTTP durumuyla birebir alırsınız.
200 OK · application/json
{
"messaging_product": "whatsapp",
"contacts": [{ "input": "15551234567", "wa_id": "15551234567" }],
"messages": [{ "id": "wamid.HBgLMTU1NTEyMzQ1NjcVAgARGBI…" }]
}
04Verilerinizi sohbetin yanında gösterin
Bir temsilci sohbeti açtığında SyBox SİZİN uç noktanızı çağırır ve verilerinizi sohbetin yanında gösterir.
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.00" }
]
}
renderAs
SyBox'a içeriği nasıl görüntüleyeceğini bildirmek için renderAs belirleyin:
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.
Herhangi bir tablo satırına sybox_ref ekleyerek tıklanabilir yapın.
Telefon ve e-posta gönderiyoruz — { renderAs, content } ile yanıt verin.
Ürün arama (X-Sybox-Action: products)
Aynı uç nokta ürün aramalarını da yanıtlayabilir. Temsilci müşterinin sorduğunu yazar, SyBox bunu "q" içinde gönderir ve yanıtınız sohbetin yanında ürün kartları olarak çizilir; Gönder düğmesi ürün bağlantısını mesaj kutusuna koyar.
Request · SyBox → your endpoint
POST YOUR_ERP_URL
Authorization: Bearer YOUR_ERP_KEY
X-Sybox-Action: products
# body: { "data": "<json string>" } — the decoded "data":
{
"q": "wireless keyboard",
"phone": "15551234567",
"email": "customer@example.com",
"ref": ""
}
Your reply · application/json
{
"content": [
{
"name": "Wireless Keyboard K380",
"price": 449,
"oldPrice": 520,
"currency": "USD",
"available": true,
"stock": 12,
"image": "https://cdn.example.com/k380.jpg",
"link": "https://shop.example.com/p/k380",
"note": "Ships in 24h"
}
]
}
name
Tek zorunlu alan. Yalnızca adı olan bir ürün de derli toplu bir kart olur.
price · oldPrice · currency
Biçimlendirilmiş metin değil, sayı gönderin. oldPrice'ı yalnızca gerçek bir önceki fiyat varsa gönderin — indirim ikisinden hesaplanır.
available · stock
available true/false'tur; stock yanında gösterilen isteğe bağlı bir sayıdır. Stok takibi yapmıyorsanız ikisini de yazmayın — olmayan alan hiçbir şey çizmez ve asla «tükendi» diye okunmaz.
image
Doğrudan bir https görsel adresi. Yüklenemeyen görsel yerine nötr bir zemin gösterilir.
link
Ürün sayfasının adresi. Olmadığında kart yalnızca görüntülenir — Gönder yalnızca gönderilecek bir şey varsa görünür.
note
Fiyatın altında kısa ve serbest tek satır — teslim süresi, bir varyant, bir koşul.
Zaten kurduğunuz uç noktadan başkası değil: aynı URL, aynı anahtar, aynı { "data": "…" } zarfı. Ürün aramasını müşteri sorgusundan ayırmak için X-Sybox-Action başlığına bakın. content'i düz bir dizi olarak döndürün (veya { items: [ … ] }).