Photos

The Photos API provides a range of actions for manipulating photos within Unet.


Basic information

Base URI

Scopes

  • photos_read
  • photos_write

Endpoints

RESOURCE_URI — URI is obtained from token exchange point.
TARGET_RESOURCE_URI — URI is obtained from the "sites/" or the "contacts/" endpoint.

Prefix Endpoint Description
RESOURCE_URI photos/ Getting a list of photos
RESOURCE_URI photos/add/ Adding a photo
RESOURCE_URI photos/ID Retrieving photo details
RESOURCE_URI photos/ID/comments/ Getting a list of photo comments
RESOURCE_URI photos/ID/comments/add/ Adding a comment for the photo
RESOURCE_URI photos/ID/rating/ Getting a list of photo ratings
RESOURCE_URI photos/ID/rating/add/ Adding a rating for the photo
RESOURCE_URI photos/ID/tag/ Tagging a photo
RESOURCE_URI photos/ID/sort/ Sorting a photo
RESOURCE_URI photos/ID/move/ Moving a photo
RESOURCE_URI photos/ID/edit/ Editing a photo
RESOURCE_URI photos/ID/delete/ Deleting a photo
RESOURCE_URI photos/categories/ Getting a list of categories
RESOURCE_URI photos/categories/add/ Adding a category
RESOURCE_URI photos/categories/ID Retrieving category details
RESOURCE_URI photos/categories/ID/edit/ Editing a category
RESOURCE_URI photos/categories/ID/sort/ Sorting a category
RESOURCE_URI photos/categories/ID/move/ Moving a category
RESOURCE_URI photos/categories/ID/delete/ Deleting a category

+Getting a list of photos

Endpoint

Scopes

  • photos_read

Request

Response


+Retrieving photo details

Endpoint

Scopes

  • photos_read

Request

Response


+Adding a photo

Endpoint

Scopes

  • photos_write

Request

Response


+Tagging a photo

Endpoint

Scopes

  • photos_write

Request

Response


+Moving a photo

Endpoint

Scopes

  • photos_write

Request

Response


+Sorting a photo

Endpoint

Scopes

  • photos_write

Request

Response


+Editing a photo

Endpoint

Scopes

  • photos_write

Request

Response


+Deleting a photo

Endpoint

Scopes

  • photos_write

Request

  • No specific request params

Response

  • No specific responce params

+Getting a list of categories

Endpoint

Scopes

  • photos_read

Request

  • No specific request params

Response


+Retrieving category details

Endpoint

Scopes

  • photos_read

Request

  • No specific request params

Response


+Adding a category

Endpoint

Scopes

  • photos_write

Request

Response


+Editing a category

Endpoint

Scopes

  • photos_write

Request

Response


+Sorting a category

Endpoint

Scopes

  • photos_write

Request

Response


+Deleting a category

Endpoint

Scopes

  • photos_write

Request

  • No specific request params

Response

  • No specific responce params

Definitions

PhotosListRequest

Name Description

limit (o)
unsigned integer

Number of items expected in response.

cursor (o)
string

The value of the next_cursor / prev_cursor parameter from the responce.
Should be empty to get the first set (page) of elements.

category_id (o)
unsigned integer

Category ID whose items are requested.

author_uid (o)
unsigned integer

User ID whose items are requested.

fields (o)
object

@PhotosItemFields
Read more about the Fields model.

PhotosItemRequest

Name Description

fields (o)
object

@PhotosItemFields
Read more about the Fields model.

PhotosListResponse

Name Description

items[]
object

@PhotosItemResponse

limit
unsigned integer

Number of returned items (items per page).

next_cursor
string

URL for the next portion of items (next page).
Empty if there is no items for the next portion.

prev_cursor
string

URL for the previous portion of items (previous page).
Empty if there is no items for the previous portion.

total_count
unsigned integer

Total number of items.

PhotosItemResponse

Name Description

id
unsigned integer

Photo ID.

category_id
unsigned integer

Album ID.

author_uid
unsigned integer

ID of the user who added the photo.

publish_time
timestamp

Publish time.

photo_url
string

Photo URL.

photo_width
unsigned integer

Photo width.

photo_height
unsigned integer

Photo height.

photo_details ?
object

@PhotosPhotoDetails

title
string

Photo title.

message ?
string

HTML formatted text of a photo.

access ?
object

@PhotosAccessModel

can_comment ?
boolean

true if there is permission to comment the photo.

can_edit ?
boolean

true if there is permission to edit the photo.

can_share ?
boolean

true if there is permission to share the photo.

is_pending ?
boolean

Flag that describes whether the photo is pending approval.

rating ?
object

RatingModel

comments_count ?
unsigned integer

Total number of comments for the photo.

shares_count ?
unsigned integer

Total number of sharings.

tags[] ?
string

The list of tags.

attachments ?
object

AttachmentStructure

PhotosPhotoDetails

Name Description

tags
object

@PhotosTagsModel
Tags details.

exif
object

@PhotosExifModel
Exif inforamtion.

PhotosEditRequest

Name Description

category_id
unsigned integer

Album ID.

title
string

Photo name.

message (r)
string

Photo description (HTML formatted).

access
object

@PhotosAccessModel

publish_at
string

Date and time of publication of the photo.
Format: ISO 8601.
Not available for use in Profile.

attachments[]
object

AttachmentsConfiguration

tags[]
string

The list of tags.
Separated by commas.

PhotosCategoriesAddRequest

Name Description

title
string

Album name.

access
object

@PhotosAccessModel

PhotosCategoriesResponse

Name Description

items[]
object

@PhotosCategoriesItemResponse

PhotosCategoriesItemResponse

Name Description

id
unsigned integer

Album ID.

title
string

Album name.

items_count
unsigned integer

Number of photos in the album.

access
object

@PhotosAccessModel

sort
unsigned integer

Sorting value.

PhotosItemSortRequest

Name Description

after_item (r)
unsigned integer

Photo ID, after which the target photo must be placed.
Specify "0" to place first.

PhotosItemSortResponse

Name Description

sort
unsigned integer

Sorting value.

PhotosCategoriesItemSortRequest

Name Description

after_item (r)
unsigned integer

Album ID, after which the target album must be placed.
Specify "0" to place first.

PhotosCategoriesItemSortResponse

Name Description

sort
unsigned integer

Sorting value.

PhotosAccessModel

Name Description

mode
string

Possible values:

  • any
  • members
  • member_groups
  • admins

member_groups
unsigned integer

Bitmask with member groups IDs
Present only if mode is member_groups

PhotosExifModel

  • orientation string
  • make string
  • model string
  • date_taken string
  • latitude float
  • longitude float
  • flash unsigned integer
  • exposure float
  • f_number float
  • focal_length float
  • digital_zoom float

PhotosTagsModel

  • id unsigned integer
  • author_uid unsigned integer
  • target_uid unsigned integer
  • created_time timestamp
  • label string
  • x unsigned integer
  • y unsigned integer
  • width unsigned integer
  • height unsigned integer
  • is_approved boolean
  • is_private boolean

PhotosItemFields

  • id
  • category_id
  • author_uid
  • publish_time
  • title
  • photo_url
  • photo_width
  • photo_height
  • photo_details ?
  • message ?
  • access ?
  • can_comment ?
  • can_edit ?
  • can_share ?
  • is_pending ?
  • rating ?
  • comments_count ?
  • shares_count ?
  • tags ?
  • attachments ?