واجهة HTTP
GET /sdk/v1/config
The app’s look, languages and screenshot mode
يُرسل مع: accept-language, X-App-Key, origin
الإجابات: 200
GET /sdk/v1/design/bundle
The app’s design: its theme, components and templates (ETag)
يُرسل مع: if-none-match, X-App-Key, origin
الإجابات: 200, 304
POST /sdk/v1/tickets
Send a contact message: payload (JSON) and at most one screenshot
يُرسل مع: X-App-Install, X-App-Key, origin, X-User-Token
المحتوى
| الحقل | النوع | مطلوب |
|---|---|---|
payload |
string | نعم |
screenshot |
string |
الإجابات: 201
POST /sdk/v1/answers
Ask the app’s help assistant: grounded in its help content, or silent
يُرسل مع: X-App-Install, X-App-Key, origin
المحتوى
| الحقل | النوع | مطلوب |
|---|---|---|
question |
string | نعم |
history |
Turn[] | |
language |
en · ar |
|
flows |
boolean |
الإجابات: 200
GET /sdk/v1/conversations
The user’s conversations, newest first
يُرسل مع: X-App-Key, origin, X-App-Install, X-User-Token
الإجابات: 200
GET /sdk/v1/conversations/{conversation_id}
One conversation’s messages
يُرسل مع: X-App-Key, origin, X-App-Install, X-User-Token
الإجابات: 200
POST /sdk/v1/conversations/{conversation_id}/messages
Write in a conversation; a closed one reopens
يُرسل مع: X-App-Key, origin, X-App-Install, X-User-Token
المحتوى
| الحقل | النوع | مطلوب |
|---|---|---|
text |
string | نعم |
الإجابات: 201
POST /sdk/v1/conversations/{conversation_id}/attachments
Send an image (a PNG or a JPEG), with words or without
يُرسل مع: X-App-Key, origin, X-App-Install, X-User-Token
المحتوى
| الحقل | النوع | مطلوب |
|---|---|---|
file |
string | نعم |
text |
string |
الإجابات: 201
POST /sdk/v1/conversations/{conversation_id}/typing
The user is typing: the team sees it for a few seconds (send at most every 3 s)
يُرسل مع: X-App-Key, origin, X-App-Install, X-User-Token
الإجابات: 204
POST /sdk/v1/conversations/{conversation_id}/seen
The user has read the conversation up to a message: its unread count drops
يُرسل مع: X-App-Key, origin, X-App-Install, X-User-Token
المحتوى
| الحقل | النوع | مطلوب |
|---|---|---|
message_id |
string (uuid) |
الإجابات: 204
GET /sdk/v1/unread
The user’s unread messages: the launcher’s badge
يُرسل مع: X-App-Key, origin, X-App-Install, X-User-Token
الإجابات: 200
GET /sdk/v1/attachments/{attachment_id}
An image of a conversation, through the signed link a message carries
الإجابات: 200
POST /sdk/v1/callbacks
Ask the team to call back: a number, what it’s about, and when suits
يُرسل مع: X-App-Install, X-App-Key, origin, X-User-Token
المحتوى
| الحقل | النوع | مطلوب |
|---|---|---|
phone |
string | نعم |
note |
string | نعم |
preferred_at |
string (date-time) | |
user_id |
string | |
language |
en · ar |
الإجابات: 201
GET /sdk/v1/home
The messenger’s home: greeting, team, help center, latest
يُرسل مع: accept-language, X-App-Key, origin, X-App-Install, X-User-Token
الإجابات: 200
GET /sdk/v1/articles
The app’s help articles: a collection’s, or those matching q
يُرسل مع: accept-language, X-App-Key, origin, X-App-Install, X-User-Token
الإجابات: 200
GET /sdk/v1/articles/{article_id}
One help article, to read in the messenger
يُرسل مع: X-App-Key, origin, X-App-Install, X-User-Token
الإجابات: 200
GET /sdk/v1/events
The user’s conversations as they happen (server-sent events; read with a streaming fetch, since it needs the app key)
يُرسل مع: Last-Event-ID, X-App-Key, origin, X-App-Install, X-User-Token
الإجابات: 200
الهوية والأحداث والموافقة
كل حزمة ترسل هوية الشخص وأحداثه وموافقته إلى هنا، بالمفتاح العام نفسه.
POST /sdk/v1/identify
Who the app’s user is; email and phone are hashed on arrival
يُرسل مع: X-User-Hash, X-App-Install, X-App-Key
المحتوى
| الحقل | النوع | مطلوب |
|---|---|---|
external_id |
string | |
email |
string | |
phone |
string | |
email_sha256 |
string | |
phone_sha256 |
string | |
attributes |
object |
الإجابات: 200
POST /sdk/v1/events
What the identified user did
يُرسل مع: X-User-Hash, X-App-Key
المحتوى
| الحقل | النوع | مطلوب |
|---|---|---|
external_id |
string | نعم |
events |
EventIn[] | نعم |
الإجابات: 200
PUT /sdk/v1/consent
What the user agreed to, per channel
يُرسل مع: X-User-Hash, X-App-Key
المحتوى
| الحقل | النوع | مطلوب |
|---|---|---|
external_id |
string | نعم |
channel |
push · in_app · email · whatsapp · sms · telegram |
نعم |
granted |
boolean | نعم |
occurred_at |
string (date-time) |
الإجابات: 200
POST /sdk/v1/install/events
What the app’s user did before the app identified them
يُرسل مع: X-App-Install, X-App-Key
المحتوى
| الحقل | النوع | مطلوب |
|---|---|---|
events |
EventIn[] | نعم |
الإجابات: 200
PUT /sdk/v1/install/consent
What the app’s user agreed to before the app identified them
يُرسل مع: X-App-Install, X-App-Key
المحتوى
| الحقل | النوع | مطلوب |
|---|---|---|
channel |
push · in_app · email · whatsapp · sms · telegram |
نعم |
granted |
boolean | نعم |
occurred_at |
string (date-time) |
الإجابات: 200
POST /server/v1/identify
Create or update a profile by the match rule
يُرسل مع: authorization
المحتوى
| الحقل | النوع | مطلوب |
|---|---|---|
external_id |
string | |
email |
string | |
phone |
string | |
email_sha256 |
string | |
phone_sha256 |
string | |
attributes |
object |
الإجابات: 200
POST /server/v1/events
Events, each naming its person
يُرسل مع: authorization
المحتوى
| الحقل | النوع | مطلوب |
|---|---|---|
events |
ServerEventIn[] | نعم |
الإجابات: 200
POST /server/v1/orders
Orders; one sent again by its order_id is updated
يُرسل مع: authorization
المحتوى
| الحقل | النوع | مطلوب |
|---|---|---|
orders |
OrderIn[] | نعم |
الإجابات: 200
PUT /server/v1/consent
What a person agreed to, per channel
يُرسل مع: authorization
المحتوى
| الحقل | النوع | مطلوب |
|---|---|---|
external_id |
string | نعم |
channel |
push · in_app · email · whatsapp · sms · telegram |
نعم |
granted |
boolean | نعم |
occurred_at |
string (date-time) |
الإجابات: 200
POST /server/v1/import
A batch of end users as text/csv or application/json (at most 10,000 rows)
يُرسل مع: authorization
الإجابات: 200
GET /server/v1/profiles/{external_id}
A person, by the org’s external id
يُرسل مع: authorization
الإجابات: 200
DELETE /server/v1/profiles/{external_id}
Delete a person and everything about them; every service forgets them too
يُرسل مع: authorization
الإجابات: 204