Download a chat attachment
- Sandbox: available
- On your own host? Choose https://{host} in the playground.
Answers a link that downloads a file sent with a message. Whoever can read the message can download its files.
Behaviour
- The link works for an hour and needs no bearer, so it fits a browser tab, a download or a PDF viewer. Ask again for a fresh one when it has run out.
- An id the message does not carry answers 404
CHAT_ATTACHMENT_NOT_FOUND.
Example
curl 'https://api.sandbox.ovok.com/v1/chat/threads/<threadId>/messages/<messageId>/attachments/<attachmentId>' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'bearerAuthorizationBearer <JWT>threadId*stringThe thread id.
^[A-Za-z0-9\-.]{1,64}$messageId*stringThe message id.
^[A-Za-z0-9\-.]{1,64}$attachmentId*stringAn attachment id, from POST /v1/chat/attachments.
^[A-Za-z0-9\-.]{1,64}$A link that downloads the file for the next hour.
application/json- response
url*stringDownloads the file; needs no bearer.
expiresAt*stringWhen the link stops working.
curl -X GET 'https://api.sandbox.ovok.com/v1/chat/threads/string/messages/string/attachments/string'{ "url": "string", "expiresAt": "string"}Get a chat message GET
One message of a thread you take part in. A message of another thread, or none, answers **404** `CHAT_MESSAGE_NOT_FOUND`. ## Example ```bash curl 'https://api.sandbox.ovok.com/v1/chat/threads/<threadId>/messages/<messageId>' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```
Mark a chat thread read POST
Marks the thread read by you, up to `readAt` (now when not sent): your unread count goes to 0, and everyone in the thread hears `chat.read` with the time, for read receipts. ## Example ```bash curl -X POST 'https://api.sandbox.ovok.com/v1/chat/threads/<threadId>/read' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{ "readAt": null }' ```