instedd / aida

10 stars 1 forks source link

Websocket attachments #210

Closed matiasgarciaisaia closed 6 years ago

matiasgarciaisaia commented 6 years ago

Make websocket support image attachments.

For that, we added a POST /api/bots/:bot_id/sessions/:session_id/attachment endpoint that receives an image as a file upload (in a file field). The endpoint returns the new upload's UUID.

After that, via the websocket, there's a new utb_img message type. It's content should have an image key, with the returned UUID value.

Images are linked to a bot & session for access control - ie, a user can't send a utb_img with the UUID of another users' image.

CC: @vtiffenberg

See #64 See #175