Skip to navigation

Update picture for room

View as Markdown

Updates the photo for a room. The image file size limit is approximately 40 MB, and you can use the following image formats:

  • jpg/jpeg
  • png
  • tiff
  • gif

In the request body of this endpoint, you can specify the image as:

  • a JSON object
  • multipart form data
  • stream data

To upload an image as a JSON object, use an object with two string properties:

  • fileName: the name of the file
  • base64Contents: the base64 representation of the image. For example a cURL request might look like this:
curl --request PUT '/restapi/v2/accounts/{accountId}/rooms/{roomId}/picture' \
--header 'Content-Type: application/json' \
--data-raw '{
"fileName":"name-of-file.jpg",
"base64Contents":"iVBOR...RK3IAK5CYII="
}'

Using multipart form data removes the need to encode images in base64 format. See Multipart form requests in Formatting API requests for details and an example.

To use other other streamed binary content types, use the Content-Disposition request header.

Content-Disposition: file; filename="hello.jpg"

Authentication

Authorizationstring

JWT Authorization header using the Bearer scheme. Example: “Authorization: Bearer {token}”

Path parameters

roomIdintegerRequired
The ID of the room.
accountIdstringRequired

The globally unique identifier (GUID) for the account.

Request

This endpoint expects a multipart form containing an optional file.
filefileOptional
File to be uploaded

Response

Picture successfully updated.
urlstringOptional
The URL for the uploaded picture.

Errors

400
Bad Request Error
401
Unauthorized Error