Apiary Powered Documentation
Sign in with Apiary account.
This document describes the basic usage for performing media creation calls on the Storyteq API. All calls will return the response as JSON.
For authentication purposes, each request to the API should have an Authorization header. Your authorization token is provided to you by Storyteq. If you are a partner or client, you can request a token by contacting teq@storyteq.com or your regular contact person.
The API's main endpoint is reachable on https://api.storyteq.com/.
You can use different versions of the API by adding a version number to the main endpoint, for example https://api.storyteq.com/v4/. Currently, the following versions of the API are running and provided with support:
v4
v3 (legacy)
This documentation only covers endpoints for version 4 of the API.
When migrating from v3 to v4, please mind the following changes in URL endpoints.
old endpoint | new endpoint |
---|---|
api/v3/templates | v4/content/templates |
api/v3/templates/{template-id} | v4/content/templates/{template-id} |
api/v3/templates/{template-id}/videos | v4/content/templates/{template-id}/media |
api/v3/templates/{template-id}/videos/{video-id} | v4/content/media/{media-id} |
Also note that some of the keys have changed when doing a GET on a media resource (previously called video).
old key | new key |
---|---|
current_state | current_status |
video_url | urls.video |
poster_url | urls.image |
The end points below should help you discover how to generate media creation calls on the Storyteq API.
Returns all templates that you have access to.
template_id |
---|
Returns a specific template.
Allows you to inspect the parameter configuration for the template. It will show you the parameter names, what types of values they accept and whether they are required or not. This information is useful when formulating a request body for media creation.
The current documentation is incomplete. The response body contains much more data. However, the data.parameters object within the response contains the parameter names you need for the template media request.
template_id |
---|
This end point is used to create media on a template. It requires you to send over key value pairs for parameters in the template_parameters object. The key represents a parameter name, the value represents the value you want to assign to the parameter in the media that will be created. We recommend retrieving a specific template first, before writing the body for this request. Retrieving the template allows you to inspect the parameter configuration for the template. It will show you the parameter names, what types of values they accept and whether they are required or not.
key | type | required | usage |
---|---|---|---|
template_parameters | object | true | Provide values for the template parameters as key (they key is parameter name) value pairs |
notifications | array | false | Provide on or more webhook URL's to receive real time status notifications for media being created |
A hard time figuring out what the parameter names actually are: How to get template parameters
Small JSON code snippet how a request with parameters would look like. Additionaly, check out the full example request below.
"template_parameters":
{
"size":"1280x720",
"parameter-698efe4d-a32e-4abd-880b-5eca9a95b245":"male",
"parameter-88aa7bbe-3ae4-4da9-8b9a-015ea5467a56":"Amsterdam",
"parameter-9a15be7d-7fb6-4a1a-b323-da3f1a4c9109":"10"
}
When providing a webhook notification route in the body of the media create request (see example), a POST request with a JSON body will be made to that endpoint for every lifecycle event the media goes through.
Only when current_status
has become finished
will the body contain urls to the rendered asset, these exist inside the urls
key.
The body of a webhook request has the following structure:
{
"id": 0,
"hash": "",
"current_status": "finished",
"urls": {
"video": "https://storage.googleapis.com/storyteq-content-delivery.../.../render.mp4"
},
"parameters": [],
"show_player_logo": false,
"template_version": 0,
"name": "",
"template_id": 0,
"template_version_id": 0,
"template": {
"id": 0,
"name": "",
"company_id": 0,
"type": 0,
"media_types": [
{
"id": 1,
"type": "video",
"created_at": "2019-09-12 13:02:23",
"updated_at": "2019-09-12 13:02:23",
"pivot": {
"template_id": 0,
"media_type_id": 1
}
},
],
"created_at": "2020-12-28 23:59:20",
"updated_at": "2021-01-08 10:03:29"
},
"events": [
{
"type": "finished",
"created_at": "2021-02-03 09:53:56"
},
{
"type": "uploading",
"created_at": "2021-02-03 09:53:54"
},
{
"type": "queued",
"created_at": "2021-02-03 09:53:48"
},
{
"type": "rendering",
"created_at": "2021-02-03 09:53:48"
}
],
"duration": 0,
"flagged": 0,
"integrations": [],
"download_urls": {
"video": "https://api.storyteq.com/v4/content/media/MEDIA_ID/download-video"
},
"review_status": null,
"review_feedback": [],
"feedback_status": null,
"publishments": [],
"created_at": "2021-02-03 09:49:22",
"updated_at": "2021-02-03 09:49:32"
}
This end point allows you to retrieve media for a template. It supports pagination and will return 50 media per page.
media_id |
---|
This end point allows you to retrieve a specific media. Even though using webhook notifications is recommended, this end point can be used to fetch the status (and other properties) and retrieve URLs once the media has reached the status 'finished'.