Get the communication record list of a specified communication customization order, supporting pagination query.
Points to note
- The interface uses the GET method and does not require the submission of request body data
- Access requires user login
- Can only retrieve communication records belonging to the current user's order
- Support pagination queries, can specify the current page number and the number of items per page
Request address
{域名地址}/api/communication/messages
Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/communication/messages
Request Syntax
GET {域名地址}/api/communication/messages
Request Headers
This interface also involves common request headers. For more information, please refer toCommon Request Headers (Common Request Headers).
Request parameters
| Field name | Type | Required | Description |
|---|---|---|---|
| comm_order_id | int | Is | Communication order ID |
| current | int | No | The current page number, default is 1 |
| page_size | int | No | Number of items per page, default is 10 |
Response header
This interface only involves public response headers. For more information, please refer toCommon Request Headers (Common Request Headers).
Return parameters
| Field name | Type | Description |
|---|---|---|
| code | int | Error code |
| msg | string | Error description |
| data | object[] | Communication record list data |
data result item parameter
| Field name | Type | Description |
|---|---|---|
| id | int | Communication Record ID |
| comm_order_id | int | Communication order ID |
| sender_id | int | sender ID |
| sender type | string | User type, user or admin or system |
| Sender name | string | Sender's name |
| Message type | string | Communication record type, text, image, quote, video, file, audio, location, contact, sticker, unknown |
| content | string | Communication record content |
Usage Example
Request example
GET /api/communication/messages?comm_order_id=123 HTTP/1.1
Host: www.anqicms.com
Content-Type: application/json
Request example (pagination query)
GET /api/communication/messages?comm_order_id=123¤t=1&page_size=5 HTTP/1.1
Host: www.anqicms.com
Content-Type: application/json
Response Example
{
"code": 0,
"msg": "",
"data": [
{
"id": 1,
"comm_order_id": 123,
"sender_id": 1000,
"sender_type": "user",
"sender_name": "testuser",
"message_type": "text",
"content": "您好,我想定制一个外贸网站主题"
},
{
"id": 2,
"comm_order_id": 123,
"sender_id": 1,
"sender_type": "admin",
"sender_name": "admin",
"message_type": "image",
"content": "https://en.anqicms.com/uploads/quote_image.jpg"
},
{
"id": 3,
"comm_order_id": 123,
"sender_id": 1,
"sender_type": "admin",
"sender_name": "admin",
"message_type": "quote",
"content": "根据您的需求,定制开发费用为9900元,包含基础功能和后期维护3个月"
}
]
}
error code
| Error code | Description |
|---|---|
| 0 | OK |
| -1 | Error, the reason is indicated in msg |
| 1001 | Not logged in |
| 1002 | Not authorized |
| 200 | API request OK |