Skip to main content

uploadRoomLogo

UploadResultWrapper uploadRoomLogo(File)

POST /api/2.0/files/logos

Upload a room logo image

Stores an image in temporary storage and answers with the path to it, which is the first half of setting a room logo. No room changes here: pass the returned path as tmpFile to POST api/2.0/files/rooms/{id}/logo, together with the crop rectangle, to make the image the logo of a room. The image travels as multipart form data, and the first file part of the request is the one that is used while any other part is ignored. It is re-encoded to PNG and scaled down to fit 1280 by 1280 pixels, so a larger picture is accepted and shrunk, while a part that is not a readable image, or one over the portal limit for uploaded images, is refused with 400. Only a room manager or a portal administrator may upload, and everyone else gets 403. Every call produces a new path, and an image that is never used stays in temporary storage until it is cleaned up, so uploading twice is harmless.

Parameters​

NameInTypeDescriptionNotes
FileformFile (binary)The image data.[optional]

Responses​

Status codeDescriptionTypeResponse headers
200The path of the stored temporary imageUploadResultWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request is not a multipart form or carries no file, or the first file is empty, larger than the portal limit for uploaded images, or not a readable PNG or JPEG image--
403Only a room manager or a portal administrator can upload a logo--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

UploadResultWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: multipart/form-data
  • Accept: application/json