This method allows an app to fetch specific messages from a conversation.
The method endpoint is https://api.flock.co/v1/chat.fetchMessages
and follows the method calling conventions.
Your app provides a list of message uids to fetch, and Flock will, in response, return a list of Message objects.
Parameters
Name | Type | Required | Description |
---|---|---|---|
token | String | Yes | Token of the user on whose behalf the message is being sent |
chat | String | Yes | Identifier for user or group for which messages are to be fetched |
uids | Array | Yes | A comma separated list of message uids (max length: 25). If a message doesn't exist for any uid, it is silently skipped. Example: |
Response
A list of Message objects.
[ { "from": "u:1e6429de-16b7-48b3-acc0-c2d7ec5ad195", "to": "u:cfc76545-3400-4864-892a-513a9f4ae409", "uid": "fd4877b719b1", "text": "Hello" }, { "from": "u:cfc76545-3400-4864-892a-513a9f4ae409", "to": "u:1e6429de-16b7-48b3-acc0-c2d7ec5ad195", "uid": "59e2da001af2", "text": "Hello again" } ]
Errors
Error Code | HTTP Status | Description | Additional Parameters |
---|---|---|---|
UnknownChat | 400 | The group or userId provided in chat is not known. |
3 Comments
Directi
Chaitanya Gupta
I have added
UnknownChat
error specific to this method – the same should be returned even if the group exists but user isn't a member.Chaitanya Gupta
Also, if no message exists for one or more uids, it should be silently skipped.