This site contains reference documentation for AssetZen’s REST API. It provides documentation and examples for all public API endpoints.
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 are the core resource in AssetZen, and most resources will refer back to images.
Search the image library. Parameters for this API are passed via the URL query.
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) |
Headers | |
---|---|
Content-Type | application/json |
application/json
{
"count": 1105,
"images": [
// List of images
]
}
Get data for a single image.
Parameters | |||
---|---|---|---|
id |
string
BAhrYglpKW5u
|
Image ID |
Headers | |
---|---|
Content-Type | application/json |
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
}
]
}
Lists CDN invalidations for the given image.
Parameters | |||
---|---|---|---|
id |
string
|
Image ID |
Headers | |
---|---|
Content-Type | application/json |
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"
}
]
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.
Parameters | |||
---|---|---|---|
id |
string
|
Image ID |
Headers |
---|
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.
Headers | |
---|---|
Content-Type | application/json |
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
}
]
The account refers to the organization level, which acts as the data owner.
Lists account information.
Headers | |
---|---|
Content-Type | application/json |
application/json
{
"name": "Example Account",
"id": "abcdefghijk",
"settings": {
}
}
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.
Headers | |
---|---|
Content-Type | application/json |
application/json
[
{
"id": 12305,
"name": "Example User",
"email": "user@example.com"
}
]