Geliştirici Dokümantasyonu

Zaten bildiğiniz bir API ile WhatsApp mesajları gönderin

Meta WhatsApp Cloud API kullandıysanız, bizimkini zaten biliyorsunuzdur. Aynı yol, aynı JSON gövdesi, aynı Bearer yetkilendirmesi.

01Hızlı Başlangıç

İlk mesajınızı göndermek için üç şey yeterli: temel URL, cihaz anahtarı ve mesaj uç noktası.

Base URL
https://api.smartsybox.com
Authentication
Authorization: Bearer <YOUR_DEVICE_KEY>
Content type
application/json

Uç Nokta

POST /v26.0/{phone-number-id}/messages
Sürüm bölümü v biçiminde kabul edilir — mevcut kodunuzu koruyun.

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…" }]
}

03Tüm mesaj türleri çalışır

Gövde aynen iletildiği için tüm Cloud API mesaj türleri desteklenir.

Request body · template
{
  "messaging_product": "whatsapp",
  "to": "15551234567",
  "type": "template",
  "template": {
    "name": "hello_world",
    "language": { "code": "en_US" }
  }
}

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: [ … ] }).

05Kendi sisteminizden kayıt açın

ERP veya muhasebe sisteminizin tek bir destek kaydı açmasını sağlayın.

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"
  }'

Alanlar

customer_unique_id
Müşterinizin kendi kayıt kimliği.
header / description
En az biri gereklidir. Başlık listenin gördüğü satırdır.
ext_ref
Bilet numaranız.
Müşteri sistemde zaten kayıtlı olmalıdır.
'case' türünde bir anahtar kullanın.

06Başka bir programdan mesaj aktarın

WhatsApp dışındaki harici sistemlerden (POS, cihaz uyarısı) gelen iletiler için.

cURL
curl -X POST "https://api.smartsybox.com/v1/inbound" \
  -H "Authorization: Bearer $SYBOX_INBOUND_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "15551234567",
    "text": "Order 4821 has left the warehouse."
  }'
Tasarım gereği yalnızca içe aktarım içindir.

07Hatalar

Hatalar Meta'dan olduğu gibi döndürülür.

4xx · application/json
{
  "error": {
    "message": "(#131030) Recipient phone number not in allowed list",
    "type": "OAuthException",
    "code": 131030
  }
}

08Cihaz anahtarı alma

Anahtarlar çalışma alanınızın içinde oluşturulur.

  • Çalışma alanınızı açın → Ayarlar → API anahtarları.
  • Her anahtar tek bir numaraya bağlıdır ve istediğiniz zaman iptal edilebilir.
  • Gerçek WhatsApp belirteciniz sunucumuzdan asla ayrılmaz.
  • Ağ geçidi varsayılan olarak kapalıdır.

WhatsApp, Messenger, and Instagram are trademarks of Meta Platforms, Inc.
SyBox™ is an independent product built on Meta Cloud API.

SMART SOUQ

SMART SOUQ SARL AU · RC Marrakech N° 154779 · RC Fès N° 87323 · ICE 003587569000031
© 2026. All rights reserved.