This documentation shows an example of creating a single video using Shakr API.
To change design elements in the template you've chosen, you can refer to template's mapping specification. Mapping specification includes information including design elements that can be edited, and you can construct a
mapping object which you can use to make an API call to create RenderSession.
For this example, we will use a template called Skin Company, a cheerful, simple-to-create template from Shakr Template Library.
Here is a sample mapping specification of Skin Company template.
From above, the most important part would be the
editables object. As the name suggests, it contains elements that can be edited, such as images, videos, and text. You can check the type of editables by referring to
After getting mapping specification, you can now build your mapping data and fill in text or media assets. Since the sample template contains text and image editables, we'll explore how to build editable data for those two types.
Text editables are the simplest form of editables that display text in the video. If you want to assign
My video text text value to
t_01 text editable, you can add it to your mapping data like below.
Image editables display images within a video and can be utilized in various ways such as photos of a product or brand logos. You need to assign URL of the image file you want to use, and how you would like to handle the image. (i.e. Cropping) For more information, please refer to Image editable documentation.
If you want to place
https://via.placeholder.com/1280x720.jpg image onto
(Footage)/USER/logo_01.png editable and fill in the display area without a gap, you can add it to your mapping data like below.
Go through all editables on mapping specification, and your mapping data is complete.
- Build a mapping: Describes additional editable types, and more.
Since now we have all the info needed to create a video, we can now create a
mapping object contains
template_style_version_id, which we acquired beforehand, and
resources object, which contains resources information within the mapping. Let's look at a sample request below.
When the request is successful, you can see that
render_session object is successfully returned.
status property in
RenderSession object changes to
preview_rendered, it means that the video is ready. You can fetch the completed video's URL by looking into
Congratulations, now you have made a video using Shakr API! 🎉