This draft only handles asset creation, editing and viewing. It does not deal with:
- API versioning
- authentication
- job control
- rundown edit
All requests are http posts to api entry point. POST payload is JSON request specified below. API server always returns HTTP response code 200, and JSON reply in the body.
{
"fulltext" : "interview",
"filters" : {
"ctime" : ["gt", 1467200000]
},
"ids" : [],
"count" : true,
"limit" : 100,
"offset" : 0,
"result" : false,
}
- fulltext - fulltext query
- filters - additional filters. TBD
- ids - if specified, result will return list of object specified by ids in this list. fulltext and filters will be ignored
- count - (optional, default false). Return count of all matching objects (for pagination)
- limit - (optional, default 0). Max count per page
- offset - (optional, default 0)
- object_type - (optional, default "asset")
- result - (optional, default false) type of the result. See "Result specification" section
{
"response" : 200,
"message" : "one asset found in 0.0000001 second",
"count" : 1,
"data" : [
{
"id_asset" : 1,
"title" : "Interview part 1",
"ctime" : 1467184934,
"mtime" : 1467220000,
}
]
}
####full
"result" : false
if not specified or false, result will contain list of asset metadata dicts (previous example)
"result" : "id"
returns list of matching ids:
"data" : [1]
"result" : ["id", "title", "duration"]
returns list of list of requested values.
"data" : [
[1, "Interview part 1"]
]
{
"data" : {
"title" : "Interview part 2",
},
"echo" : true
}
- data
- object_type - (optional, default "asset")
- echo
{
"response" : 201,
"message" : "Asset created",
"data" : {
"id" : 2,
"title" : "Interview part 2",
"ctime" : 1467219595,
"mtime" : 1467219595,
}
}
- response - status code. always present
- message - human readable message. always present
- data - metadata of the created object. present only if "echo" param in request is true.
Additionaly, if list of object ids is specified, set
method allows single object or batch metadata editing.
{
"ids" : [1,2],
"data" : {
"editorial_format" : "interview",
"director" : "John Doe"
},
"echo" : true
}
{
"response" : 200,
"message" : "2 assets updated",
"data" : [
{
"id" : 1,
"title" : "Interview part 1",
"editorial_format" : "interview",
"director" : "John Doe",
"ctime" : 1467184934,
"mtime" : 1467220000,
},
{
"id" : 2,
"title" : "Interview part 2",
"editorial_format" : "interview",
"director" : "John Doe",
"ctime" : 1467219595,
"mtime" : 1467220000,
}
]
}
- response - status code. always present
- message - human readable message. always present
- data - metadata of the updated objects (list of dicts). present only if "echo" param in request is true.
Since deletion is just a metadata flag, trashing can be done using set request.