Asset API

An Asset, at it’s core, is simply a file. The general expectation, however, is that this file is quite large, and may be in a binary format. An Asset has some associated metadata.

Asset Creation

POST /v1/asset/

Create a new asset from the File Data in the body of the request. If the ‘related-id’ and ‘related-type’ are also populated, then an Asset Relationship is created as well.

Query Parameters:
 
  • content-type (string) – Optional. The content type of the asset (ie. application/json).
  • file-type (string) – Optional. The file type of the asset (ie. json).
  • related-id (string) – Optional. Must appear with ‘related-type’. Used to create a relationship to the specified object.
  • related-type (string) – Optional. Must appear with ‘related-id’. Used the create a relationship of the specified type.
  • asset-type (string) – Optional. Populated into the query-able Asset Metadata.
Request Headers:
 
Status Codes:

http

POST /v1/asset HTTP/1.1
Host: localhost:5635
Content-Type: multipart/form-data

curl

curl -i -X POST http://localhost:5635/v1/asset -H 'Content-Type: multipart/form-data'

wget

wget -S -O- http://localhost:5635/v1/asset --header='Content-Type: multipart/form-data'

httpie

http POST http://localhost:5635/v1/asset Content-Type:multipart/form-data

python-requests

requests.post('http://localhost:5635/v1/asset', headers={'Content-Type': 'multipart/form-data'})

response

HTTP/1.1 200 OK
Location: http://localhost:5635/v1/asset

new-asset-key

Asset Update

POST /v1/asset/{asset_key}

Update an existing Asset. This returns a new key for the asset, and adds an entry to the associated Asset History. This will also update all relationships which were associated to the old Asset, and associate them to the new Asset.

Query Parameters:
 
  • content-type (string) – Optional. The content type of the asset (ie. application/json).
  • file-type (string) – Optional. The file type of the asset (ie. json).
  • asset-type (string) – Optional. Populated into the query-able Asset Metadata.
Request Headers:
 
Status Codes:

http

POST /v1/asset/{key} HTTP/1.1
Host: localhost:5635
Content-Type: multipart/form-data

curl

curl -i -X POST 'http://localhost:5635/v1/asset/{key}' -H 'Content-Type: multipart/form-data'

wget

wget -S -O- 'http://localhost:5635/v1/asset/{key}' --header='Content-Type: multipart/form-data'

httpie

http POST 'http://localhost:5635/v1/asset/{key}' Content-Type:multipart/form-data

python-requests

requests.post('http://localhost:5635/v1/asset/{key}', headers={'Content-Type': 'multipart/form-data'})

response

HTTP/1.1 200 OK
Location: http://localhost:5635/v1/asset/{key}

new-asset-key

Asset Retrieval

GET /v1/asset/(asset_key)

Retrieve an asset by ID.

Status Codes:

http

GET /v1/asset/{key} HTTP/1.1
Host: localhost:5635

curl

curl -i 'http://localhost:5635/v1/asset/{key}'

wget

wget -S -O- 'http://localhost:5635/v1/asset/{key}'

httpie

http 'http://localhost:5635/v1/asset/{key}'

python-requests

requests.get('http://localhost:5635/v1/asset/{key}')

Asset Count

GET /v1/asset/count

Count the total number of assets matching the given query.

Query Parameters:
 
  • content-type (string) – Optional. The content type of the asset (ie. application/json).
  • file-type (string) – Optional. The file type of the asset (ie. json).
  • asset-type (string) – Optional. Valid options are ‘standard’ (for normal assets), and ‘thumbnail’ for thumbnail assets.
Status Codes:

http

GET /v1/asset/count?file-type=obj HTTP/1.1
Host: localhost:5635

curl

curl -i 'http://localhost:5635/v1/asset/count?file-type=obj'

wget

wget -S -O- 'http://localhost:5635/v1/asset/count?file-type=obj'

httpie

http 'http://localhost:5635/v1/asset/count?file-type=obj'

python-requests

requests.get('http://localhost:5635/v1/asset/count?file-type=obj')

Asset Metadata Query

GET /v1/asset

Query Asset Metadata based on various attributes.

Query Parameters:
 
  • content-type (string) – Optional. The content type of the asset (ie. application/json).
  • file-type (string) – Optional. The file type of the asset (ie. json).
  • asset-type (string) – Optional. Valid options are ‘standard’ (for normal assets), and ‘thumbnail’ for thumbnail assets.
  • limit – Optional. The maximum number of records to return.
  • offset – Optional. The number of records to skip, enabling pagination with the ‘limit’ parameter.
Status Codes:

http

GET /v1/asset?file-type=obj HTTP/1.1
Host: localhost:5635

curl

curl -i 'http://localhost:5635/v1/asset?file-type=obj'

wget

wget -S -O- 'http://localhost:5635/v1/asset?file-type=obj'

httpie

http 'http://localhost:5635/v1/asset?file-type=obj'

python-requests

requests.get('http://localhost:5635/v1/asset?file-type=obj')

Asset Deletion

DELETE /v1/asset/(asset_key)

Delete an asset.

Status Codes:

http

DELETE /v1/asset/{key} HTTP/1.1
Host: localhost:5635

curl

curl -i -X DELETE 'http://localhost:5635/v1/asset/{key}'

wget

wget -S -O- --method=DELETE 'http://localhost:5635/v1/asset/{key}'

httpie

http DELETE 'http://localhost:5635/v1/asset/{key}'

python-requests

requests.delete('http://localhost:5635/v1/asset/{key}')