Reply message
Post a reply to one message as an existing member, in the same channel, forum topic or direct conversation.
- Method
- POST
- Path
https://api.returning.ai / v1/ messages/ reply - Permission
- replyMessage
- Retries
- Not idempotent; check Get Messages before retrying
When to use this
- A trader asks a question in a channel and your support account answers it in the thread.
- Your system reacts to a message it read with Get Messages and answers that message directly.
- You reply to a trader's comment in a forum topic.
Authentication#
- Header
Authorization: Bearer <API_KEY>- Permission
- replyMessageShown in the dashboard as “Reply Message”
Use a Community API key with replyMessage, and keep it on your server. The key decides the community, so never send a community ID. A personal user API key with its own reply permission also works; then the reply is posted as the key's owner.
Behaviour#
The reply goes where the original message is: the same channel, the same forum topic, or the same direct conversation. It appears straight away, posted as sender. The sender earns the usual XP and reply counts, mentioned members are mentioned, and your community's message webhooks fire.
A reply whose text contains a link is handled as a file: the whole message is fetched as a file URL and posted as an attachment. If it can't be fetched, the call fails with 400 Error downloading file. Leave links out of replies.
Request#
Headers#
Body#
data.messages.id in Get Messages.RuleMessage ID
Eg"66f000000000000000000a21"
RuleUsername or email of a member
Eg"support@example.com"
@username.RuleAt least 1 character
Eg"Yes, Friday at 14:00 GMT."
curl --request POST \
--url https://api.returning.ai/v1/messages/reply \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"messageId": "66f000000000000000000a21",
"sender": "support@example.com",
"message": "Yes, Friday at 14:00 GMT. The link is in the announcements channel."
}'
Response#
A 200 means the reply was posted. The response has no ID; read the channel with Get Messages to find it.
{
"status": "success",
"message": "Message reply successfully"
}
Errors#
Validation errors use meta, message, detail and solution, with detail naming the field. Every other error has message, sometimes with status or detail. None has a machine-readable code, so branch on the HTTP status and read message.
Fix the request03
messageId, an empty message, or an ID that isn't 24 hex characters (detail names the field). Sender field is required means you used a Community API key without sender. Error downloading file means the text contains a link that couldn't be fetched (see Behaviour). Nothing was posted.Invalid token), unknown (Invalid API key) or expired, or it lacks replyMessage (Your API key does not have permission to access this action). Add the permission in Settings > Integration > API Keys.Fix the data01
message says which: Message not found (check messageId with Get Messages), User not found (no member has that sender), Recipient not found, or Channel not found. Nothing was posted.Retry with backoff01
Authentication failed). The reply may already be posted, so check Get Messages before you retry.{
"meta": {
"status": "error",
"statusCode": 400
},
"message": "Reply Message Validation validation error.",
"detail": {
"messageId": "Required",
"message": "Required"
},
"solution": "Check your body in request and try again"
}