Updated on 2025-03-31 GMT+08:00

Submitting a Message by a Customer (doLeaveMessage)

Scenario

This API is used to submit the message content of a customer. After a customer fails to be connected to an agent, this API is invoked to submit the message information of the customer.

Method

POST

URI

https://Domain name/apiaccess/ccmessaging/doLeaveMessage (For example, the domain name is service.besclouds.com.)

Request Description

Table 1 Request header parameters

No.

Parameter

Type

Mandatory or Not

Description

1

ccmessaging-token

String

Yes

Value of ccmessaging-token generated by the applyToken interface

2

x-app-key

String

Yes

App key, which is the user ID and is configured on the API Fabric

3

Authorization

String

Yes

Authentication field. The format is Bearer {Value of AccessToken returned by the tokenByAkSk interface}. (A space is required after Bearer.)

Table 2 Request body parameters

No.

Parameter

Type

Mandatory or Not

Description

1.1

callId

String

Yes

User ID. The value is a string of 1 to 24 characters.

1.2

caller

String

Yes

Number for leaving a message

1.3

leaveMessage

String

Yes

Message information

1.4

channel

String

Yes

Channel name. The value is WEB.

Response Description

  • Status code: 200
Table 3 Response body parameters

No.

Parameter

Type

Description

1.1

resultCode

String

Return code

1.2

resultDesc

String

Return description

If resultCode is 0, no description is returned, or the description is Save leaveMessage success!

If resultCode is 3, the description is the leaveMessageParams is error.

If resultCode is 13, the description is Exception appeared! or Save leaveMessage failed!

  • Status code: 400

    Incorrect request. Check the request path and parameters.

  • Status code: 401

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

  • Status code: 404

    The requested content is not found. Check the request path.

  • Status code: 500

    Business failure. Check the values of parameters in the request.

Error Codes

None

Example

Request header:

{
	"ccmessaging-token": "eyJjcmVhdGV*************2hhbm5lbElkIjoiMjAyMTAyMTkzMTk2ODY5NzA4In0%3D",
	"x-app-key": "ea5c29a3*************a3dbeb4c32c",
	"Authorization": "Bearer 57042f*************968c4e0",
	"Content-Type": "application/json"
}

Request parameters:

{
	"callId": "111111222111",
	"caller": "138****7777",
	"leaveMessage": "Please reply",
	"channel": "WEB"
}

Response parameters:

{
	"resultCode": "0",
	"resultDesc": "Save leaveMessage success!"
}