Skip to main content
Uploading Media Files
M
Written by Meg Payne
Updated over 2 years ago

NOTE: all requests must be authenticated.


Required Record Details

In order to send a message to a conversation you need:


Uploading Media

Path

Method

POST

Response Type

application/json

The request body must be multipart/form-data consisting file being uploaded. It is not possible to upload multiple files in a single request.

URL Path Parameters

Name

Value

org-id

the UUID of the org in which you wish to use the media

user-id

the UUID of your user account

Example Request

$ curl \
-X 'POST' \
-H 'Content-Type: multipart/form-data; boundary=----6UZdxcHPfgwy4u9F' \
-H 'Authorization: Token <auth token value>' \
-H 'Content-Length: <file size in bytes>' \
--data-binary $'------6UZdxcHPfgwy4u9F\r\nContent-Disposition: form-data; name="file"; filename="example.png"\r\nContent-Type: image/png\r\n\r\n\r\n------6UZdxcHPfgwy4u9F--\r\n' 'https://devapi.yapsterchat.com/api/orgs/<org-id>/org-users/<user-id>/files'

A successful response will be a JSON document consisting of a single string value which specifies the uploaded file path. You can use this path as the media URL in other API requests (e.g. as the cover image of a conversation, as content in a news post or message, etc.)

Did this answer your question?