Begin Event

This event object is used when a bot and a user start a 1:1 message room.
It occurs in the following cases, where an event object whose type property is "begin" is sent.

  • When a user creates a 1:1 message room with the bot
  • When the bot sends a message to a user for the first time using the API
  • When a 1:1 message room with the bot is created using the API

Request {#begin-event-request}

ParameterTypeRequiredDescription
typestringYSet this parameter to "begin".
sourceobjectYThe subject that sent a callback message.
source.userIdstringYThe ID of the user who started the 1:1 conversation.
source.channelIdstringYThe ID of the 1:1 message room with the bot.
source.domainIdnumberYThe domain ID of the 1:1 message room.
issuedTimestringYThe date and time when the event occurred (format: YYYY-MM-DDThh:mm:ss.SSSZ).

Request example {#begin-event-request-example}

POST /callback HTTP/1.1Host: YOUR_SERVER_HOST_NAMEContent-type: application/json; charset=UTF-8X-WORKS-Signature: 9crxWhZ9aQO/9ruUM4MH3dF/WRGYRhj0vSR4cRyJfHQ=X-WORKS-BotId: 123{  "type": "begin",  "source": {    "userId": "user0001-e3e9-4063-1d22-04978003f354",    "channelId": "12345",    "domainId": 40029600  },  "issuedTime":"2022-01-04T05:16:05.716Z"}

Response (customer's server receiving messages -> message server) {#begin-event-response}

It should return HTTP status 200 if successful.
The HTTP request sent by a callback is not resent even if it failed.

Response {#begin-event-response-example}

HTTP/1.1 200 OKContent-Type: application/jsonServer: YOUR_SERVER_HOST_NAMEContent-Length: 0