Public API for Inbox Integration
Introduction
The Public Integration API enables you to perform certain actions with the Inbox Integration without the need to operate in the platform UI. With the Integration API, you can also control the inbox integration with chatbot logic.
API Endpoint
Please use the following Endpoint URL for the Public Integration API:
https://api.inbox.woztell.sanuker.com/v1.0/
Authentication
To perform authentication for Integration APIs, it is needed to utilize the corresponding Payload and SignedContext which is required by the integration.
- Payload: a
JSON
stringify instance - SignedContext:
(signature).{{base64(JSON.stringify(payload))}}
- Obtain the information related to the Inbox Integration by querying the
installedIntegrations
with Open API.
Request:
query {
apiViewer{
installedIntegrations{
appId
_id
signature
integrationId
}
}
}
Response:
{
"data": {
"apiViewer": {
"installedIntegrations": [
{
"appId": "62062c0b717195320192b18f7",
"_id": "6420fig28e65b466d4607ea2",
"signature": "mKq60mpKn/YzaP5123tWU+AWX65LqT6BHkBIfq9d3os=",
"integrationId": "inbox"
}
]
}
}
}
Create Payload with in the following format:
{"appIntegration":"appIntegrationId","app":"appId"}
Example Payload:
{"appIntegration":"6420fig28e65b466d4607ea2","app":"62062c0b717195320192b18f7"}
Encode the Payload
Base64
formatCombine the encoded Payload and Signature in order to create the SignedContext in the following format:
(signature).{{base64(JSON.stringify(payload))}}
Example SignedContext
mKq60mpKn/YzaP5123tWU+AWX65LqT6BHkBIfq9d3os.eyJhcHBJbnRlZ3JhdGlvbiI6IjY0MjBmaWcyOGU2NWI0NjZkNDYwN2VhMiIsImFwcCI6IjYyMDYyYzBiNzE3MTk1MzIwMTkyYjE4ZjcifQ==
- Add them to the header as the
X-Woztell-Payload
andX-Woztell-SignedContext
.
POST/update-thread-folder
This API is for assigning a thread to a specific folder.
Parameters:
Name | Type | Description | Required |
---|---|---|---|
memberId | string | Member ID | Yes |
folderId | string | Folder ID | Yes |
Request:
{
"memberId": "920o80371234550009a01abd",
"folderId": "test-folder"
}
Response:
{
"ok": 1,
"thread": {
"_id": "640a123opp71ee2b943ed283",
"wAppId": "90283b9b71780112208b18f7",
"wChannelId": "621f29ae4e11986de280e29d",
"wMemberId": "630d8962168350009a01acd",
"_version": 2,
"createdAt": 1678377627235,
"etag": "d-bkiiEXyVO8CtQ9cHw/5zjO581rM",
"externalId": "8521234567",
"folder": "test-folder",
"lastChatAt": 1682454661289,
"lastMessage": "[Bot] Hello there!",
"threadId": "T0000999",
"title": "John Lee",
"updatedAt": 1682661372214,
"lastReadAt": 1682487947711,
"unreadCount": 0
}
}