Integration - Synchronous Mode:
- Select the channel on Bot builder for your bot
- Create an application or select an existing application
- Use the client id and client secret to generate the JWT
- Select the mode synchronous, copy the webhook URL and save the channel
- Approve the channel on admin
- Now hit the webhook URL using the incoming request payload as mentioned at the instructions while enabling channel
- Below snip shows the response received to webhook URL.
Integration - Asynchronous Mode:
1)Enable the channel on Bot builder for your bot
- Create an application or select an existing application
- Use the client id and client secret to generate the JWT
- Select the mode Asynchronous
- Provide the post URL and access token to receive the Asynchronous message
- copy the webhook URL and save the channel
- Approve the channel on admin
- Now hit the webhook URL using the incoming request payload as mentioned at the instructions while enabling channel
- The user should receive an empty message with 200 status code for the request made to webhook URL and an asynchronous message is sent to the post URL as shown in below snips
Below is the asynchronous message sent to the post URL. The access token is sent as authorization in the headers.
Below is a sample cURL to use the webhook channel:
curl -X POST
https://bots.kore.ai/chatbot/hooks/st-8d0a0e2a-a107-5384-b08b-42133e2b9371
-H ‘authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYXBwSWQiOiJjcy0yOGZhODNjMi1hMmY2LTUwZGEtYmU1YS04MjZiMzc4ZGEyNTEifQ.oyY3suCu_p0Hr3b58oOGtHPa7HVG00X5Za5tf9k2cWk’
-H ‘cache-control: no-cache’
-H ‘content-type: application/json’
-H ‘postman-token: 90a15790-0dd1-40b3-e0af-360fe60475d4’
-d '{
“message”: {
“text” : “hi”
},
“from” : {
“id”: “1323465”
},
“to” : {
“id”: “4321”
}
}’