Upload an image or file into a Room
POST
/api/v1/rooms/{roomId}/assets
const url = 'https://api.yggy.tech/api/v1/rooms/example/assets';const form = new FormData();form.append('file', 'file');form.append('kind', 'image');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.yggy.tech/api/v1/rooms/example/assets \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form file=@file \ --form kind=imageStores an image (PNG, JPEG, WebP or GIF up to 10 MB, saved as WebP) or a file (an accepted document type up to 50 MB) for the Room. Place it with an image or file card that names the returned assetId. Counts toward the org’s storage.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” roomId
required
string
Request Body
Section titled “Request Body ” Media type multipart/form-data
object
file
The image or file.
string format: binary
kind
required
Image: shown on the board. file: offered as a download.
string
Responses
Section titled “ Responses ”Uploaded
Media type application/json
object
assetId
required
string
kind
required
string
name
required
string
contentType
required
string
size
required
integer
width
required
integer | null
height
required
integer | null
Example
{ "kind": "image"}Invalid file or storage limit reached
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
required
string
details
Example
{ "success": false, "error": { "code": "INTERNAL_ERROR" }}Unauthorized
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
required
string
details
Example
{ "success": false, "error": { "code": "INTERNAL_ERROR" }}Forbidden
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
required
string
details
Example
{ "success": false, "error": { "code": "INTERNAL_ERROR" }}Room not found
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
required
string
details
Example
{ "success": false, "error": { "code": "INTERNAL_ERROR" }}Too many uploads
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
required
string
details
Example
{ "success": false, "error": { "code": "INTERNAL_ERROR" }}