وثائق المطورين

API المطور المرجع

استخدم REST API لإرسال الرسائل، إدارة جهات الاتصال، الحملات، التجارة، و Webhooks.

التوثيق

الرابط الأساسي

https://talyapp.net/api

المصادقة

Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
Content-Type: application/json

جهات الاتصال

GET/api/contacts

جلب قائمة جهات الاتصال

curl -X GET "https://talyapp.net/api/contacts?page=1&per_page=25" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
POST/api/contacts

إضافة جهة اتصال

PUT/api/contacts/{uuid}

تعديل جهة الاتصال

DELETE/api/contacts/{uuid}

حذف جهة اتصال

مجموعات جهات الاتصال

GET/api/contact-groups

جلب قائمة مجموعات جهات الاتصال

curl -X GET "https://talyapp.net/api/contact-groups?page=1&per_page=25" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
POST/api/contact-groups

إضافة مجموعة جهات اتصال

PUT/api/contact-groups/{uuid}

تعديل مجموعة جهات اتصال

DELETE/api/contact-groups/{uuid}

حذف مجموعة جهات اتصال

الردود الآلية

GET/api/canned-replies

جلب الردود الآلية

curl -X GET "https://talyapp.net/api/canned-replies?page=1&per_page=25" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
POST/api/canned-replies

إضافة رد آلي

PUT/api/canned-replies/{uuid}

تعديل رد آلي

DELETE/api/canned-replies/{uuid}

حذف رد آلي

الرسائل

POST/api/send

إرسال رسالة

curl -X POST "https://talyapp.net/api/send" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
  "phone": "+966500000001",
  "message": "Hello John, how can we help you today?",
  "header": "Customer support",
  "footer": "Reply with one of the options below",
  "buttons": [
    { "id": "sales", "title": "Sales" },
    { "id": "support", "title": "Support" }
  ]
}'
POST/api/send/media

إرسال وسائط

POST/api/send/template

إرسال قالب

الحملات

POST/api/campaigns

إنشاء حملة

curl -X POST "https://talyapp.net/api/campaigns" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "April property follow-up",
  "template": "00000000-0000-4000-8000-000000000000",
  "contacts": "all",
  "skip_schedule": true,
  "body": {
    "parameters": [
      { "type": "text", "text": "Ahmed" }
    ]
  }
}'

التجارة

GET/api/commerce/products

جلب المنتجات

curl -X GET "https://talyapp.net/api/commerce/products?page=1&per_page=20" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
POST/api/commerce/products

إضافة منتج

PUT/api/commerce/products/{uuid}

تعديل منتج

GET/api/commerce/orders

جلب الطلبات

GET/api/commerce/orders/{uuid}

تفاصيل طلب

PATCH/api/commerce/orders/{uuid}/status

تغيير حالة طلب

GET/api/commerce/appointments

جلب الحجوزات

GET/api/commerce/appointments/{uuid}

تفاصيل حجز

PATCH/api/commerce/appointments/{uuid}

تعديل حجز

القوالب

GET/api/templates

جلب القوالب

curl -X GET "https://talyapp.net/api/templates?page=1&per_page=25" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"

التحقق

GET/api/verify

التحقق من المفتاح

curl -X GET "https://talyapp.net/api/verify" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"

Error responses

Standard error

{
  "statusCode": 403,
  "code": "message_limit_reached",
  "message": "You have reached your message limit.",
  "request_id": "req_01hxexample"
}

Validation error

{
  "statusCode": 400,
  "code": "validation_error",
  "errors": {
    "phone": ["The phone number is not valid."]
  }
}
Taly API للمطورين | رسائل وتكاملات وWebhooks