Photos Collection
API Methods to work with Photos
Photo is entity to represent photo associated with Property and Room Type (optional).
Photos List
Retrieve list of Photos associated with user Properties.
Request:
Returns
Success
Method can return a Success result with 200 OK
HTTP Code if operation is successful. Will contain a list of Photo objects in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized
HTTP Code if wrong Bearer Token provided.
Get Photo by ID
Retrieve specific Photo by ID.
Request:
Returns
Success
Method can return a Success result with 200 OK
HTTP Code if operation is successful. Will contain a Photo object in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized
HTTP Code if wrong Bearer Token provided or User not have access to requested Photo.
Not Found Error
Method can return a Not Found Error result with 404 Not Found
HTTP Code if Photo with provided ID is not present at system.
Create Photo
Create new Photo.
Request:
Query body (JSON):
Fields
property_id [required]
String with valid UUID of Property object what you would like to associate with created Photo.
url [required]
Valid URL address of Photo image.
room_type_id [optional]
String with valid UUID of Room Type object what you would like to associate with created Photo.
If room_type_id
is null
, Photo will be associated only with Property.
kind [optional]
One of three possible values: photo
, ad
(advertising), menu
(restaurant menu photo).
By default value kind will be equal to photo
.
author [optional]
Name of photo author.
description [optional]
Text with Photo description.
position [optional]
Any positive integer number.
This field represent Photo position at list of Property or Room Type Photos. Photo with position equal to 0 is used as Cover Photo.
Position should be uniq per property_id
and room_type_id
combination.
Returns
Success
Method can return a Success result with 201 Created
HTTP Code if operation is successful. Will contain a Photo object in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized
HTTP Code if wrong Bearer Token provided.
Validation Error
Method can return a Validation Error result with 422 Unprocessable Entity
HTTP Code if any validation rule is failed.
Upload Photo
To upload Photos and create it you should use next API:
In response you will get a link to temporary photo:
Then you can use this url
in Create Photo API call.
Update Photo
Update Photo.
Request:
Query body (JSON):
Fields
This method use same fields as Create Photo method.
Returns
Success
Method can return a Success result with 200 OK
HTTP Code if operation is successful. Will contain a Photo object in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized
HTTP Code if wrong Bearer Token provided.
Not Found Error
Method can return a Not Found Error result with 404 Not Found
HTTP Code if Photo with provided ID is not present at system.
Validation Error
Method can return a Validation Error result with 422 Unprocessable Entity
HTTP Code if any validation rule is failed.
Remove Photo
Remove Photo.
Request:
Returns
Success
Method can return a Success result with 200 OK
HTTP Code if operation is successful. Will contain a Meta object with message in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized
HTTP Code if wrong Bearer Token provided.
Not Found Error
Method can return a Not Found Error result with 404 Not Found
HTTP Code if Photo with provided ID is not present at system.
Batch operations
API methods to create or update Property or Room Type have implementation of Photo batch operations.
To create Property with Photos, you can pass list of Photo arguments as value into content.photos
key of affected object.
Batch operations support logic to create new Photo entity associated with parent object, update existed photos or drop it.
To update Photo at batch operation, you must provide photo with it ID.
To drop Photo at batch operation, you can pass additional optional key: is_removed
with value equal to true
at Photo object what are you like to remove.
Baseline loading.
Progressive loading.
Last updated
Was this helpful?