Skip to content

Latest commit

 

History

History
80 lines (57 loc) · 2.01 KB

perform-handover.md

File metadata and controls

80 lines (57 loc) · 2.01 KB

Perform Handover

Action to Perform an Handover

  • URL

    REST API URL can be found on Apps Page
    image 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:

    1. action = handover

    2. 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" }
  • 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]" }
  • 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"
        }
      }