Action to Perform an Handover
-
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
=handover
-
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.
Optional:
actionData: { `targetDepartment=[string]` }
-
-
Success Response:
- Code: 200
Content:{ result: "Perform Handover 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 occurred while processing perform-handover. Details:- [Error Details]" }
- Code: 400 BAD REQUEST
-
Sample Call:
Curl
curl "http://localhost:3000/api/apps/public/783d8e4d-b06a-409a-aaf3-b37650dc0a26/incoming" \ -X POST \ -d "{\n \"action\": \"close-chat\",\n \"sessionId\": \"GeTEX3iLYpByZWSze\",\n \"actionData\": {\n \"targetDepartment\": \"SalesDepartment\"\n }\n}" \ -H "Content-Type: application/json" \ -H "content-length: 65"
HTTP
POST /api/apps/public/783d8e4d-b06a-409a-aaf3-b37650dc0a26/incoming HTTP/1.1 Host: localhost:3000 Content-Type: application/json { "action": "handover", "sessionId": "hmZ9EGL3LFvHSeG2q", "actionData": { "targetDepartment": "SalesDepartment" } }