Updated on 2024-03-05 GMT+08:00

POST /ccmessaging/send

Description

Sending channel messages, including connection messages, sending input status messages, session messages, transfer to manual services, and disconnection messages

Method

POST

URI

https://Domain Name/apiaccess/ccmessaging/send.For example,the domain name is service.besclouds.com.

Request

Table 1 Header Parameters

Seq.

Name

Type

Mandatory

Description

1

ccmessaging-token

string

True

ccmessagign-token generated by the applyToken interface

2

x-app-key

string

True

The same as app_key, which uniquely identifies a user, Configuring the ApiFabric Tool

3

Authorization

string

True

Authentication field. The value format is as follows: Bearer +AccessToken in the return values of the tokenByAKSK interface (there is a space after Bearer)

Table 2 Body Parameters

Seq.

Name

Type

Mandatory

Description

1

reqBody

5.1.2

True

Request body

Response

  • Status code: 200

    5.1.1

  • Status code: 400

    Incorrect request:Check the request path and parameters.

  • Status code: 401

    Unauthorized:1.Check whether you have purchased related services.2.Contact the customer service personnel to check the current status of your account.

  • Status code: 404

    Request not found: Check the request path.

  • Status code: 500

    Service failure:Check the values of the parameters in the request.

Error Code

None.

Message Example

  • Scene description: Connecting Robots

    URL:

    Request Parameter:

    { "content": "", "controlType": "CONNECT", "from": "session_1619573111751_user_1619573111751", "mediaType": "TEXT", "senderNickname": "user_1619573111751", "sourceType": "CUSTOMER", "timestamp": "1619573122352", "to": "1011577355744904195", "userAgent": null, "senderAvatar": null, "channel": "WEB" }

    Response Parameter:

    { "resultCode": "0", "resultDesc": "connect to robot success." }

  • Scene description: Talk to Bot Request

    URL:

    Request Parameter:

    { "content": "Version", "controlType": "CHAT", "from": "session_1619573111751_user_1619573111751", "mediaType": "TEXT", "senderNickname": "user_1619573111751", "sourceType": "CUSTOMER", "timestamp": "1619573123199", "to": "1011577355744904195", "userAgent": null, "senderAvatar": null, "channel": "WEB" }

    Response Parameter:

    { "resultCode": "0", "resultDesc": "Send message to robot successfully" }

  • Scene description: Robot-to-manual request

    URL:

    Request Parameter:

    { "content": "", "controlType": "TRANS2AGENT", "from": "session_1619573111751_user_1619573111751", "mediaType": "TEXT", "senderNickname": "user_1619573111751", "sourceType": "CUSTOMER", "timestamp": "1619573129953", "to": "1011577355744904195", "userAgent": null, "senderAvatar": null, "channel": "WEB" }

    Response Parameter:

    { "resultCode": "0", "resultDesc": "transfer from robot to agent success." }

  • Scene description: Disconnection request

    URL:

    Request Parameter:

    { "content": "", "controlType": "DISCONNECT", "from": "session_1619573842490_user_1619573842490", "mediaType": "TEXT", "senderNickname": "user_1619573842490", "sourceType": "CUSTOMER", "timestamp": "1619573854156", "to": "1011577355744904195", "userAgent": null, "senderAvatar": null, "channel": "WEB" }

    Response Parameter:

    { "resultCode": "0", "resultDesc": "Disconnect robot successfully" }