Transfer a Message Session

Transfer a message session to an extension user, message queue, or third-party message analytics platform.

Request URL

POST {base_url}/{api_path}/message_session/transfer?access_token={access_token}

Request parameters

Parameter Required Type Description
session_id Yes Integer The unique ID of the message session.
Note: You can query the message session ID using Search Specific Message Sessions.
destination_type Yes String The type of the destination to which the session will be transferred.
Valid value:
  • extension: Extension user.
  • queue: Message queue.
  • api: Third-party message analytics platform.
destination_id No Integer The unique ID of the destination to which the session will be transferred.
Valid value:
  • If destination_type is set to extension or queue, this parameter is REQUIRED and is used to specify the corresponding ID of the destination.
    Note: You can query the extension ID using Search Specific Extensions, and query the message queue ID using Search Specific Message Queues.
  • If destination_type is set to api, you can set the value to 0 or leave it empty.

Response parameters

Table 1.
Parameter Type Description
errcode Integer Returned error code.
  • 0: Succeed.
  • Non-zero value: Failed.
Note: You can check the error code and error message in Error Code and Error Message.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.

Examples

Request example

Transfer a message session (ID: 3073) to an extension (ID: 138).

POST /openapi/v1.0/message_session/transfer?access_token=xMv4MJAruG8wFiqj0f0y8tgaMvR44nQm HTTP/1.1
Host: 192.168.5.150:8088

Content-Type: application/json

{
  "session_id": 3073,
  "destination_type": "extension",
  "destination_id": 138  
}

Response example

HTTP/1.1 200 OK
{
    "errcode": 0,
    "errmsg": "SUCCESS"
}