NOTE: all requests must be authenticated.
Required Record Details
In order to send a message to a conversation you need:
The org
id
of the organization you wish to use the media file within.See: Finding Orgs
Your
user_id
.
Uploading Media
Path | |
Method |
|
Response Type |
|
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.)