AssetZen


Introduction

This site contains reference documentation for AssetZen’s REST API. It provides documentation and examples for all public API endpoints.

Usage Notes

All API methods require OAuth2 authentication and must be run with a user grant. You will need to create an application in order to perform API requests.

API usage is subject to the API usage agreement

All response data is scoped to the user the request is performed for, usually at an organization level.

Unique identifiers are provided in the field sid and contain case-sensitive alpha-numeric values, currently 12-characters in length. Numeric IDs (id) may be provided in some cases, however where an sid is provided it should always be used over a numeric ID.

To use the API you must either set the HTTP Accept header to application/json or append .json to the path of all request URLs.

All APIs respond with JSON data, and accept requests either as application/json or as application/x-www-urlencoded

Images

Images are the core resource in AssetZen, and most resources will refer back to images.

Search Images

Search the image library. Parameters for this API are passed via the URL query.

REQUEST

Parameters
q string food

Search Query

uploaded_from string 1495200928

Oldest date to include, UNIX timestamp.

uploaded_to string 1495207928

Newest date to include, UNIX timestamp.

uploader string 2048

ID of user who uploaded image.

tags string food

List of tags to match, all of which must be present for an image to match.

albums string BAhrYglpKW5u

List of album IDs, images must be present in at least one of the listed albums.

page string 1

Page number of results to get.

limit string 100

Maximum number of results to return. (Default 25, maximum 500)

RESPONSE

Headers
Content-Type application/json
200 application/json
                        {
"count": 1105,
"images": [
  // List of images
]
}

                      
                        
                      

Get an image

Get data for a single image.

REQUEST

Parameters
id string BAhrYglpKW5u

Image ID

RESPONSE

Headers
Content-Type application/json
200 application/json
                        {
"id": 41801,
"sid": "BAhrYglpKW5u",
"title": "Example Image",
"description": "Example Description",
"alt_text": "Example Text",
"tags": ["Example", "tag", "list"],
"file_name": "example_file_name.jpg",
"content_type": "image/jpeg",
"file_size": 4042065,
"created_at": "2017-05-19T15:22:27.568Z",
"updated_at": "2017-05-19T15:42:40.477Z",
"dimensions": {
  "x0": 2880,
  "y0": 1920,
  "x1": 0,
  "y1": 0
},

"default_focus": {
  "x": 1451,
  "y": 1044
},

"exif": {
  "FNumber": "2.0"
},

"license": "C",

"suggested_tags": [
  {
    "tag": "water",
    "confidence": 83.7663531303406
  },

  {
    "tag": "river",
    "confidence": 81.1934232711792
  }
]
}

                      
                        
                      

List Invalidations

Lists CDN invalidations for the given image.

REQUEST

Parameters
id string

Image ID

RESPONSE

Headers
Content-Type application/json
200 application/json
                        [
{
  "user": {
    "id": 1000,
    "email": "user@example.com",
    "name": "Example User"
  },
  "status": "completed",
  "created_at": "2017-05-17 09:02:20Z",
  "completed_at": "2017-05-17 09:02:50Z",
  "reference": "I1AG0OXD8ULMCQ"
}
]

                      
                        
                      

Create Invalidation

Request CDN invalidation for the given image.

Note that the invalidation process is asynchronous and depending on the CDN platform can take several minutes to complete.

Invalidations are subject to stricter usage limits than other APIs and should be used only when removal of an image from CDN edge locations is absolutely nessacary.

REQUEST

Parameters
id string

Image ID

RESPONSE

Headers
Albums

Albums are collections of images, with some additional properties.

Album IDs and SIDs are unique across accounts, however we recommend as a best practise to always store account identifiers along-side album data in external systems.

List Albums

REQUEST

RESPONSE

Headers
Content-Type application/json
200 application/json
                        [
{
  "id": 2017,
  "title": "Example Album",
  "parent_id": null,
  "sid": "pLpS8ah8YVme",
  "description": null,
  "created_at": "2017-04-28T13:55:45.106Z",
  "updated_at": "2017-05-10T14:41:51.854Z",
  "is_public": true
}
]

                      
                        
                      
Account

The account refers to the organization level, which acts as the data owner.

Get Account Details

Lists account information.

REQUEST

RESPONSE

Headers
Content-Type application/json
200 application/json
                          {
    "name": "Example Account",
    "id": "abcdefghijk",
    "settings": {
    }
  }

                      
                        
                      

List Account Users

Lists users in an account.

User IDs and Emails are currently unique across accounts, however this may change, therefore best practise is to not rely on this and always shard users by account when storing user information.

REQUEST

RESPONSE

Headers
Content-Type application/json
200 application/json
                          [
    {
      "id": 12305,
      "name": "Example User",
      "email": "user@example.com"
    }
  ]