Action to Close a Chat Session
-
URL
REST API URL can be found on Apps Page
Sample Url for eg:
http://localhost:3000/api/apps/public/783d8e4d-b06a-409a-aaf3-b37650dc0a26/incoming
-
Method:
POST
-
Input Data Format
JSON
-
Data Params
Required:
-
action
=close-chat
-
sessionId=[string]
Note. Session Id is the same session of Dialogflow. Also note that, session Id is the same as Room Id on Rocket.Chat. Click here to know more about Dialogflow sessions.
-
-
Success Response:
- Code: 200
Content:Close chat request handled successfully
- Code: 200
-
Error Response:
-
Code: 400 BAD REQUEST
Content:
{ error: "Error: Session Id not present in request" }
OR -
Code: 500 Internal Server Error
Content:
{ error : "Error!! Invalid Action type" }
OR
- Code: 500 Internal Server Error
Content:
{ error : "Error occurred while processing close-chat. Details:- [Error Details]" }
-
-
Sample Call:
Curl
curl "http://localhost:3000/api/apps/public/783d8e4d-b06a-409a-aaf3-b37650dc0a26/incoming" \ -X POST \ -d "{\n \"sessionId\": \"2Sfq8wXw4fYPMf6r4\"\n}" \ -H "Content-Type: application/json"
HTTP
POST /api/apps/public/783d8e4d-b06a-409a-aaf3-b37650dc0a26/incoming HTTP/1.1 Host: localhost:3000 Content-Type: application/json { "action": "close-chat", "sessionId": "2Sfq8wXw4fYPMf6r4" }