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

GET /ccmessaging/poll

Description

Receiving channel messages (pull mode)

Method

GET

URI

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

Request

Table 1 Query Parameters

Seq.

Name

Type

Mandatory

Description

1

receiverId

string

False

Recipient ID

2

channel

string

False

Recipient Channel Type

Table 2 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,configuration on the API Fabric

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)

Response

  • Status code: 200

    3.1.2

  • 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: Message Example

    URL: Domain Address/apiaccess/ccmessaging/poll?receiverId=XXXXXXXXXXXXXXXXXXXXXXXX&channel=WEB

    Request Header:

    ccmessaging-token: XXXXXXXXX

    Response Parameters:

    { "resultCode": "0", "resultDesc": "query user messages success.", "downlinkMessages": [ { "from": "1011577355744904195", "channel": "WEB", "to": "session_fixed_user_fixed", "controlType": "CHAT", "mediaType": "TEXT", "content": "Welcome,welcome", "simQuestions": null, "senderNickname": "test", "senderAvatar": "1", "timestamp": 1619590480756, "sourceType": "ROBOT", "callId": null, "robotGender": "MALE" }, { "from": "1011577355744904195", "channel": "WEB", "to": "session_fixed_user_fixed", "controlType": "CHAT", "mediaType": "TEXT", "content": "Transfer to manual labor", "simQuestions": null, "senderNickname": "test", "senderAvatar": "1", "timestamp": 1619590482098, "sourceType": "ROBOT", "callId": null, "robotGender": "MALE" }, { "from": "1011577355744904195", "channel": "WEB", "to": "session_fixed_user_fixed", "controlType": "CHAT", "mediaType": "TEXT", "content": "Connected Agent", "simQuestions": null, "senderNickname": "System", "senderAvatar": null, "timestamp": 1619590484115, "sourceType": "SYSTEM", "callId": null, "robotGender": null } ] }