• KB Home
  • API
  • edna Chat Center API for Bot Connect
  • Client Сontact Provided Webhook

Client Сontact Provided Webhook

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.

FieldTypeDescription
actionboolean (required)CLIENT_CONTACT.
threadsClientIdlong (optional)The internal client ID (suitable for authorized and unauthorized clients).
sessionIdstring (optional)The internal thread ID.
channelInfoobject (required)The information about the channel where the message was received. Fields:
channelType (string): channel type;
authorized (boolean): true (authorized), false (unauthorized).
platformstring (optional)Only for the channel type (channelType) MOBILE:
• iOS;
• Android.
clientDatadictionary (optional)The client data (see more).
receivedAtstring (required)The time at which the message was received. Date in UTC format: yyyy-MM-dd’T’HH:mm:ss.SSS’Z’.
senderstring (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

ResponseDescription
200The request was processed successfully.
4хх-5ххRequest processing failed. In this case, the reason for the error should be included in the request body.