The Client contact provided webhook to notify the bot of receiving client data.
The bot can send a request to receive client data for the Telegram channel only. To do this, you need to send a quick response with the CONTACT
type in the message.
Client Data Request Message Example
{ "action" : "MESSAGE", "threadsClientId" : 1, "sessionId": "1", "questionId": 43, "questionIndex": null, "text": "Message", "sender": "ThreadsAPI", "receivedAt" : "2023-08-15T11:49:02.397Z", "quickReplies" : [ { "type" : "CONTACT", "text" : "Текст сообщения" }, { "type" : "TEXT", "text" : "quick reply 1",} ], "settings" : { "blockInput" : true, "masked" : false} }
When data is received from the client, a data message is sent to this webhook.
Field | Type | Description |
action | boolean (required) | CLIENT_CONTACT. |
threadsClientId | long (optional) | The internal client ID (suitable for authorized and unauthorized clients). |
sessionId | string (optional) | The internal thread ID. |
channelInfo | object (required) | The information about the channel where the message was received. Fields: • channelType (string): channel type;• authorized (boolean): true (authorized), false (unauthorized). |
platform | string (optional) | Only for the channel type (channelType ) MOBILE : • iOS; • Android. |
clientData | dictionary (optional) | The client data (see more). |
receivedAt | string (required) | The time at which the message was received. Date in UTC format: yyyy-MM-dd’T’HH:mm:ss.SSS’Z’. |
sender | string (required) | The sender information, always ThreadsAPI. |
HTTP Request Example
POST <url for webhook message> HTTP/1.1 Content-Type: application/json { "action":"CLIENT_CONTACT", "threadsClientId":1, "sessionId":"1", "receivedAt":"2018-11-13T13:13:11.876Z", "channelInfo":{ "channelType":"TELEGRAM", "authorized":true , "clientData":{ "phone":"79000000000" , "sender":"ThreadsAPI"
Responses
Response | Description |
200 | The request was processed successfully. |
4хх-5хх | Request processing failed. In this case, the reason for the error should be included in the request body. |