Import messages
Imports one or more messages into a conversation.
You can only import messages sent by conversation participants. You can't import messages sent by guests or system messages.
Imported messages don't trigger notifications. Moreover, changes due to importing messages aren't synchronized back to active clients. If a user is currently reading a conversation that you're importing messages into, they need to reload before they see the imported messages.
Import messages with attachments
To import messages with attachments into a conversation, do the following:
- Upload the file. You'll receive an attachmentToken in response.
- Specify the attachmentToken when importing the message.
The message is now imported with its attachment.
Duplicates
Duplicate messages aren't removed. If you've sent or imported the same message twice, the message shows up twice, even if the messages have the same timestamp.
Test and live mode
Import your data into the TalkJS test mode first to check if everything works as expected, before you import your data into live mode.
If anything goes wrong while testing your import, you can use the Reset all data button on the Settings page of your dashboard to irrevocably delete all messages, conversations, and users.
Request
- Base URLhttps://api.talkjs.com
- Auth
- HTTP bearer
- or HTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
A unique identifier of your TalkJS app. You can find your app ID on the Settings page of your dashboard.
A unique identifier of a conversation.
Request body
Example request
[
{
"text": "Great! Let's do that",
"sender": "alice",
"timestamp": 1629972494633,
"readBy": [
"zayneb",
"sebastian"
],
"type": "UserMessage",
"attachmentToken": "aBcdeFGHijKLMNoPQrsT0123456789",
"custom": {
"priority": "high"
}
}
]Response
Empty response
Empty response
Changes
No recorded changes to this operation across all 1 revision of this API.