ImportPeerMsg
https://zim-api.zego.im/
If you are using another instant messaging service and want to integrate with ZIM, you can call this API to import the user's historical one-to-one messages (in chronological order) to ZIM.
A one-to-one conversation has two users (user A and B). User A may have deleted some messages, resulting in a different message list that user A can see in this conversation compared to user B. Therefore, for the same one-to-one conversation, this API needs to be called separately for users A and B.
The parameters FromUserId and ToUserId only support numbers, English characters, and {'!','#','$','%','&','(',')','+','-',':',';','<','=','.','>','?','@','[',']','^','_',' ','{','}','|','~'}.
To provide developers with a better experience, ZEGOCLOUD recommends that developers use the latest version of the SDK.
If the sender requests to send a text message with MessageType 1, the sender's corresponding client (SDK version needs to be 2.7.0 or above) will also receive the message.
For sending and receiving custom messages with MessageType 200, the SDK version of the sender's and receiver's corresponding clients needs to be 2.8.0 or above.
If the receiver's SDK version is in the [2.0.0, 2.8.0) range, they can receive custom messages, but the message type will be displayed as unknown and the message content cannot be obtained. To obtain this message, please upgrade the SDK to version 2.8.0 or above.
If the receiver's SDK version is 1.x.x, they will not be able to receive custom messages, nor will they receive unknown messages.
Verify the effect
After successfully importing messages, you can call the ZIM server-side API Query the message list of one-on-one chats to confirm whether the user's one-to-one conversation messages have been imported completely.
Request
Query Parameters
Possible values: [ImportPeerMsg]
API prototype parameter
https://zim-api.zego.im/?Action=ImportPeerMsg
💡Public parameter. Application ID, assigned by ZEGOCLOUD. Get it from the ZEGOCLOUD Admin Console.
💡Public parameter. A 16-character hexadecimal random string (hex encoding of 8-byte random number). Refer to Signature example for how to generate.
💡Public parameter. Current Unix timestamp, in seconds. Refer to Signature example for how to generate, with a maximum error of 10 minutes.
Possible values: [2.0]
Default value: 2.0
💡Public parameter. Signature version number.
💡Public parameter. Signature, used to verify the legitimacy of the request. Refer to Signing the requests for how to generate an API request signature.
- application/json
Responses
- 200
- application/json
