Photo /photo/{photo-id}

Represents an individual photo.

Reading

GET /photo/{photo-id} HTTP/1.1
Host: localhost:3000

Permissions

  • An access token is required.
  • If access token points to a workspace, all the criteria must be met :
    • The workspace_photos permission is granted.
    • If the tmp field of the photo is set to true, the photo is owned by the current workspace.
    • If the tmp field of the photo is set to false, the applied permissions to retrieve the target at which is attached the photo are granted.
  • If access token points to an user, all the criteria must be met :
    • The user_photos permission is granted.
    • If the tmp field of the photo is set to true, the photo is owned by the current person.
    • If the tmp field of the photo is set to false, the applied permissions to retrieve the target at which is attached the photo are granted.

Fields

Name Description Type

_id

The photo ID.

string

name

The name of the photo.

string

tmp

Set to true if the photo is a temporary file (not attached to an object).

boolean

type

The type of the photo.

enum{image/jpeg, image/jpg, image/png, image/gif}

images

The images created from the original photo.

object

original

The original photo.

object

url

The url of the original photo.

string

size

The size of the original photo.

string

dimensions

The dimensions of the photo.

object

width

The width of the original photo (in pixels).

number

height

The height of the original photo (in pixels).

number

large

The large photo.

object

url

The url of the large photo.

string

size

The size of the large photo.

string

dimensions

The dimensions of the photo.

object

width

The width of the large photo (in pixels).

number

height

The height of the large photo (in pixels).

number

small

The small photo.

object

url

The url of the small photo.

string

size

The size of the small photo.

string

dimensions

The dimensions of the photo.

object

width

The width of the small photo (in pixels).

number

height

The height of the small photo (in pixels).

number

icon

The icon photo.

object

url

The url of the icon photo.

string

size

The size of the icon photo.

string

dimensions

The dimensions of the photo.

object

width

The width of the icon photo (in pixels).

number

height

The height of the icon photo (in pixels).

number

owner

The ID of the User who added the photo.

User

target

The ID of the Edge at which is attached the photo.

Edge

thirdparty

The ID of the Thirdparty who added the photo.

Thirdparty

workspace

The ID of the Workspace at which is attached the photo.

Workspace

created_time

The date that indicates when the photo was created.

date

updated_time

The date that indicates when the photo was updated for the last time.

date

Computed fields

Name Description Type

url

The url of the original photo.
Taken from images.original.url field.

string

size

The size of the original photo.
Taken from images.original.size field.

string

dimensions

The dimensions of the photo.
Taken from images.original.dimensions field.

object

width

The width of the original photo (in pixels).

number

height

The height of the original photo (in pixels).

number

large_url

The url of the large photo (250x250 pixels).
Taken from images.large.url field.

string

small_url

The url of the small photo (100x100 pixels).
Taken from images.small.url field.

string

icon_url

The url of the icon photo (32x32 pixels).
Taken from images.icon.url field.

string

Publishing

You can publish photos by using the /object/photos edge when it is present on a node.

Updating

PUT /photo/{photo-id} HTTP/1.1
Host: localhost:3000

Permissions

  • An access token with manage_photos permission is required.
  • The tmp field of the photo must be set to true.
  • If access token points to an user, the photo must be owned by the current person.
  • If access token points to a workspace, the photo must be owned by the current workspace.

Fields

Name Description Type

target

The ID of the Edge at which is attached the photo.

Edge

Response

If successful :

{
    "success": true
}

Otherwise a relevant error message will be returned.

Deleting

DELETE /photo/{photo-id} HTTP/1.1
Host: localhost:3000

Permissions

  • An access token with manage_photos permission is required.
  • If access token points to a workspace, at least one of the following criteria must be met :
    • The tmp field of the photo is set to true, the photo is owned by the current workspace.
    • The tmp field of the photo is set to false, the applied permissions to update the target at which is attached the photo are granted.
  • If access token points to an user, at least one of the following criteria must be met :
    • The tmp field of the photo is set to true, the photo is owned by the current person.
    • The tmp field of the photo is set to false, the applied permissions to update the target at which is attached the photo are granted.

Fields

No fields are required.

Response

If successful :

{
    "success": true
}

Otherwise a relevant error message will be returned.

Edges

No edges.