An asset is a resource that each device will need in order to accurately depict objects around it. This can vary, from an .obj file, containing mesh information, to a .glsl file, containing shader information, to a .png or .jpg file containing an image. Assets can either be associated to a Scene or an Object, or anything else by Asset Relationships.
A Scene Asset is a file that devices may need to utilize in order to synchronize views of scenes with other devices, such as a photograph of a specified object or marker. It can also include map/level mesh and shader information, for use with VR/traditional video games. This API allows for the storage and retrieval of such files.
An Object Asset is a file that is used to construct an Object. Entire collections of assets are expected to be downloaded for each object, and so registering to a scene is expected to incur a large set of downloads to collect all of the assets within that scene.
When authentication is active, assets are associated to the user that creates them and can be public or private. Users can only interact with assets that are either public, or that they own.
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: | |
---|---|
|
|
Request Headers: | |
|
|
Status Codes: |
|
POST /v1/asset HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data
"file=@testupload.txt"
curl -i -X POST http://localhost:8080/v1/asset -H 'Content-Type: multipart/form-data' --data-raw '"file=@testupload.txt"'
HTTP/1.1 200 OK
Location: http://localhost:8080/v1/asset
Content-Type: text/plain
abcdef
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: | |
---|---|
|
|
Request Headers: | |
|
|
Status Codes: |
|
POST /v1/asset/key HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data
"file=@testupload.txt"
curl -i -X POST http://localhost:8080/v1/asset/key -H 'Content-Type: multipart/form-data' --data-raw '"file=@testupload.txt"'
HTTP/1.1 200 OK
Location: http://localhost:8080/v1/asset
Content-Type: text/plain
abcdef
GET /v1/asset/key HTTP/1.1
Host: localhost:8080
curl -i http://localhost:8080/v1/asset/key
GET
/v1/asset/count
¶Count the total number of assets matching the given query.
Query Parameters: | |
---|---|
|
|
Status Codes: |
|
GET /v1/asset/count?file-type=obj HTTP/1.1
Host: localhost:8080
curl -i 'http://localhost:8080/v1/asset/count?file-type=obj'
GET
/v1/asset
¶Query Asset Metadata based on various attributes.
Query Parameters: | |
---|---|
|
|
Status Codes: |
|
GET /v1/asset?file-type=obj HTTP/1.1
Host: localhost:8080
curl -i 'http://localhost:8080/v1/asset?file-type=obj'
POST
/v1/bulk/asset
¶Get Asset Metadata by IDs in bulk.
Request Headers: | |
---|---|
|
|
Status Codes: |
|
DELETE /v1/asset/key HTTP/1.1
Host: localhost:8080
curl -i -X DELETE http://localhost:8080/v1/asset/key
GET
/v1/asset/
(asset_key)¶An Asset History is a record of all the versions of a particular asset.
Status Codes: |
|
---|
GET /v1/asset-history/key HTTP/1.1
Host: localhost:8080
curl -i http://localhost:8080/v1/asset-history/key
HTTP/1.1 200 OK
Location: http://localhost:8080/v1/asset-history/key
Content-Type: application/json
[{
"id": "5ab878ca98afd7729e928dd5",
"scene": "testScene",
"object": "testObject",
"asset": "5ab878c998afd7729e928dd3",
"assetIds": [
"5ab878c998afd7729e928dd3",
"5ab878b098afd7729e928dd1"
]
}]