Eko API Integration
Search…
Webhook API
Webhooks allow developer to subscribe to events that are happening with Bot in Eko. Eko can send an HTTP request to an endpoint that you configure. There are 2 types of event including Create a chat and sending a message.

User create a chat room

When a user create a 1-1 chat room with bot for first time, Eko will send an event to customer endpoint.
"root":
"events":
0:
"replyToken": "d4c1027bafd76d1ed1ab08dd0ffd9cdd15608fcb"
"type": "join"
"source":
"type": "direct_chat"
"uid": "5d8af2ff164176ecaec49e5c"
"timestamp": 1569563054859

Message request

When the bot has sent a message, the endpoint will receive a request from the Eko server once the bot is sent a message as below
Method
POST
Request body sample
{
events:
[
{
replyToken: '8350939af2afb69a969649e1e8a943',
type: 'message',
source:
{
type: 'user',
userId: '5ac20cd38c62770001538ece'
username: 'u1.tutorial'
},
message:
{
id: '5bcaa50554ffc8d4b1a861b1',
type: 'text',
groupId: '5ae99669299892c81ec1d7fa',
topicId: '5ae996692998924badc1d7fb',
text: 'hello'
},
timestamp: '2018-10-19T03:46:07.866Z'
}
]
}
Request parameters
Name
Type
Description
replyToken
string
reply token to acknowledge which message the bot is replying to
type
string
message type
source
object
information of the user who sent the message
message
object
message information and content
timestamp
datetime
time when the message was sent
Copy link
On this page
User create a chat room
Message request