Overview
Imports message history and creates the corresponding conversations. Import messages in chronological order whenever possible.
Request
Authentication: Add authentication headers to the request. See Authentication.
Method
POST
Rate limit
100 requests/second
Endpoint https://API domain/apigateway/hismsgs/import
Content-Type
application/json
Request Parameters
| Parameter | Data Type | Required | Description | |
|---|---|---|---|---|
| from_id | string | No | For a private chat, the ID of one participant. Maximum length: 32 characters. | |
| target_id | string | Yes | For a private chat, the ID of the other participant; for a group chat, the group ID. Maximum length: 32 characters. | |
| channel_type | int | Yes | Conversation type. 1: private chat; 2: group chat. | |
| msg_time | int | Yes | Message timestamp in milliseconds. | |
| msg_type | string | Yes | Message type. Maximum length: 50 characters. | |
| msg_content | string | Yes | Message content. JSON format is recommended. |
Request Example
POST /apigateway/hismsgs/import HTTP/1.1
appkey: appkey
signature: 2e639ae3600a4sdff61fb88b76f485b
nonce: nonce
timestamp: 1672568121910
Content-Type: application/json
{
"from_id":"xxx",
"target_id":"xxx",
"channel_type":1,
"msg_time":1723245643456,
"msg_type":"text",
"msg_content":"{\"content\":\"aabbcc\"}"
}
Response Example
{
"code":0,
"msg":"sucess"
}