Attachments

Downloading files with the key and temporary signed links for outside systems.

An attachment inside a message #

FieldTypeReq.Description
iduuidyesfile id
typestringyesimage, document, audio, video
namestringnofile name
sizeintnosize in bytes
mimeTypestringnocontent type
urlstringnoa signed link with an expiry
urlExpiresAtRFC 3339nowhen the link stops working

The signed link #

GET /media/signed/{id}?exp=…&sig=…

The link needs no key: another server opens it, and it has no entrance of ours. The protection is the signature and the one-hour expiry. Conversations must not be served from a guessable address, so open attachment links do not exist.

Download with the key #

GET /api/v1/media/{id} media:read

Serves the file itself with its content type. Useful when the signed link expired or when your server code fetches the file.

Example call
curl -s -o act.pdf https://api.widgetchat.ru/api/v1/media/9f2c… -H "Authorization: Bearer wck_…"