Introduction
The Rocketium video API opens up parts of the Rocketium platform so third-party developers can create and manipulate videos programmatically. The APIs enable you to not only carry out simple video creation tasks, but complex operations like video trimming, cropping, changing video speed, and reversing clips.
Authentication
To authorize, use this code:
import requests
url = "https://api.rocketium.com"
payload = ""
headers = {
'access_token': "<YOUR_API_KEY>",
'Content-Type': "application/json"
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
## With shell, you can just pass the correct header with each request
curl "https://api.rocketium.com"
--header "access_token: <YOUR_API_KEY>"
--header "Content-Type: application/json"
var data = JSON.stringify(false);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.rocketium.com");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
Rocketium uses API keys to allow access its various APIs. Please refer the Quick Starter Guide to get your unique API key. You can use this API key to try our APIs in our Sandbox.
Quickstart
Welcome to the Quickstart Guide for trying out Rocketium’s APIs. Please follow the steps below to create sample automated videos using APIs for free.
Step 1. Sign up
You need to be a signed up user to obtain an API key (no credit card required). In case you do not have an account with Rocketium, please head to Signup page and create a free account. If you already have an account with Rocketium, please login here.
Step 2. Generate API Key
Once you sign up or login, please head to your account settings. Go to the API tab to generate your personal API key.
Step 3. Try out video creation in our Sandbox
You can use your unique API key in our sandbox to call video APIs. For detailed information on the APIs and related parameters please go through the documentation in the next section.
Step 4. Create custom videos
You can change the parameters in the sandbox to generate custom videos by using the API for "Create Video". Click "Submit" and the generated video will be available in your Rocketium dashboard. As a free user you will be able to make up to 10 videos with the Rocketium watermark. Click on "Get Code" to copy the code to run it outside the sandbox.
API - Create video
Rocketium Create video API lets you programmatically create videos using images, clips, text, and audio. The Header should contain the access token, which you generated in the previous section. If you do not have an access token, please head to Quickstart section to generate one.
import requests
url = "https://api.rocketium.com/videos"
payload = "{\n \"title\": \"Benefits of using Rocketium\",\n \"themeId\": \"599ec30b27855975ab36a1b9\",\n \"scenes\": [{\n \"text\" : \"Rocketium is easy to use\",\n \"image\" : \"https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4\"\n },\n {\n \"text\" : \"Rocketium has its own API\",\n \"image\" : \"https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4\"\n }]\n}"
headers = {
'access_token': "<YOUR_API_KEY>",
'Content-Type': "application/json"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
curl --request POST \
--url https://api.rocketium.com/videos \
--header 'Content-Type: application/json' \
--header 'access_token: <YOUR_API_KEY>' \
--data '{"title": "Benefits of using Rocketium", "themeId": "5a15310cabc5e17e6bf29525", "scenes": [{"text" : "Rocketium is easy to use", "image" : "https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4"}, { "text" : "Rocketium has its own API", "image" : "https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4" }]}'
var data = JSON.stringify({
"title": "Benefits of using Rocketium",
"themeId": "599ec30b27855975ab36a1b9",
"scenes": [
{
"text": "Rocketium is easy to use",
"image": "https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4"
},
{
"text": "Rocketium has its own API",
"image": "https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4"
}
]
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.rocketium.com/videos");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
Make sure to replace
<YOUR_API_KEY>
with your API key along withthemeId
andscenes
data.
URL
Access the Create Video API at https://api.rocketium.com/videos
. Try in Sandbox.
HTTP Method
POST request
Headers
- Access token -
'access_token': '<YOUR_API_KEY>'
- Content type -
'Content-Type': 'application/json'
Request
Body
Key | Type | Value |
---|---|---|
scenes | Array of Scene objects | Every video consists of multiple scenes, each with media (image, video, or GIF), voice-over, and captions. This field has details of the scenes. |
themeId | String | ID of theme to be used to apply styles. You can get this by calling the Get Themes API. |
teamId (optional) | String | ID of workspace where the exported video should be saved. If this is not specified, the video will be available in the last workspace you have opened. Please talk to your account manager to get this ID. |
title (optional) | String | Title of the video. This will be visible in your workspace. |
logoImage (optional) | String | URL of image to be used as logo. |
logoCustomPosition (optional) | Logo custom position | Custom position for logo. |
metadata (optional) | JSON String or Targets array | A custom object that can be sent to be associated with this video. This entire object will be sent in the response to a webhook callback, if any. This is useful for associating videos with users, products, or any other internal identifiers. If the object has an array of Share objects with the targets key, the video will be shared to the specified destinations after it has been rendered. |
audio (optional) | String | URL of an audio file. If this is not provided, audio from the specified theme will be used. |
draftOnly (optional) | boolean | Passing true will only create a draft in the Rocketium library but not render it as an mp4 video file. The default value is false i.e. without any input for this parameter a video will be generated and count against the 10 videos for a free user. |
id (optional) | String | The unique ID of a video returned from an earlier create API call. This can be used to make a copy of an existing video. |
audio_mood (optional) | String | One of cheerful , dramatic , serious , inspirational , bright , comical , country . If this is present, the file specified in audio will be ignored and we will randomly select an audio track from Rocketium's free audio library in the specified category. |
orientation (optional) | String | One of landscape , square , portrait , fbCover , instagramAd |
videoBackground (optional) | String | URL of an image or video to use as the background of the entire video. This will only show up in scenes where the image does not cover the entire scene. |
brandColors (optional) | Array | Array of hexcodes of colors to be used as brandColors in the creative. A brand colour must be defined for various elements (overlays, text colors, background color, etc.) while creating the template. Users can directly pass colour hex codes in the JSON to get appropriate colour. |
export-settings (optional) | Export setting object | Additional export settings for the video such as bitrate. |
Export Settings object
Key | Type | Value |
---|---|---|
bitrate (optional) | String | The expected average bitrate of the exported video. 1M indicates 1 megabits per second quality, 1.5M indicates 1.5 megabits per second quality, and so on. You can also specify values in kilobits per second - 1000k is 1,000 kilobits per second, 1500k is 1,500 kilobits per second. |
quality | String | sets the quality of the video exported. values can be 360p , 720p , 1080p . |
fadeOutVideo (optional) | Boolean | Specify if the video should fade to black at the end. Default value is true . |
fadeOutAudio (optional) | Boolean | Specify if the audio should fade out at the end. Default value is true . |
Scene object
Key | Type | Value |
---|---|---|
image | String, Media object, Search result object | The image, GIF, or video to be shown in the scene. If a string is passed, it should be a publicly accessible link to the file. |
text (optional) | String, Array of String, Text object, Array of Text object | Captions in the scene. Text can include HTML formatting tags h1 , strong , and em . |
delay (optional) | Number | Number of seconds by which all the captions in this scene should be delayed |
multiplier (optional) | Number | Speed at which the text should be shown. See note on speed and calculation of caption duration. |
styles (optional) | Scene styles object | Additional styles that should be applied to this scene. These styles will override styles specified in the theme. |
audio (optional) | String, Text-to-speech API request data | URL of an mp3 file containing the voice-over for this scene. Can also share text and voice to create voice-over automatically by passing parameters for the text-to-speech API. |
Media object
Key | Type | Value |
---|---|---|
url | String | URL of the image, GIF, or video. This should be publicly accessible. If using Google Drive, Dropbox, or other cloud storage links, ensure that the link is to the direct file not a page with comments and download / share buttons. |
fullDuration (optional) | Boolean | If true , the video in the scene will play for its full duration. If false , it will play as long as the captions. |
loop (optional) | Boolean | If true , the video in the scene will loop when its duration is shorter than the duration of the scene. If false , it will stop at its last frame instead of looping. |
mute (optional) | Boolean | If true , the audio in the video in this scene will be muted |
user (optional) | String | Text attribution for the content owner. For example, Aaron (Unsplash) or HBO (Youtube) |
access-type (optional) | String | Specify how the object should be accessed. Allowed value is secure-s3 . Ensure that you have set the appropriate S3 policy. Please get in touch with us to get the correct S3 bucket policy. |
icon (optional) | String | An icon to indicate the source of this image or video. This should be passed as an HTML snippet - <i class="ICON"></i> . Allowed values for ICON are:-
|
fit (optional) | Boolean | Specify if the provided image be fit in the container or not. |
mediaType (optional) | String | Specify the media type, accepted values: map , image , video . |
mapDetails (optional) | Object | Map object. If mediaType is selected as map . |
Map object
Map object can be provided in accordance to the Google Maps Apis
Key | Type | Value |
---|---|---|
center | String | defines the center of the map, equidistant from all edges of the map. This parameter takes a location as a comma-separated {latitude,longitude} pair (e.g. "40.714728,-73.998672") identifying a unique location on the face of the earth. |
zoom | Integer | defines the zoom level of the map, which determines the magnification level of the map. This parameter takes a numerical value corresponding to the zoom level of the region desired. For more information, see zoom levels. |
size | String | defines the rectangular dimensions of the map image. This parameter takes a string of the form {horizontal_value}x{vertical_value}. For example, 500x400 defines a map 500 pixels wide by 400 pixels high. |
markers (optional) | Array | Array of Map Marker Objects. |
style (optional) | Array | defines a custom style to alter the presentation of a specific feature (roads, parks, and other features) of the map. The object details is in accordance to Snazzy Maps. |
Map Marker Object
Key | Type | Value |
---|---|---|
location optional | String | provide the location to put the marker, if not provided map center will be used as the marker. |
size (optional) | String | specifies the size of marker from the set {tiny, mid, small} . If no size parameter is set, the marker will appear in its default (normal) size. |
color (optional) | String | specifies a hex code (example: color=#007EFF) or a predefined color from the set {black, brown, green, purple, yellow, blue, gray, orange, red, white}. |
label (optional) | String | specifies a single uppercase alphanumeric character from the set {A-Z, 0-9}. Note that default and mid sized markers are the only markers capable of displaying an alphanumeric-character parameter. tiny and small markers are not capable of displaying an alphanumeric-character. |
Text object
Key | Type | Value |
---|---|---|
text (optional) | String, Array of String | Captions in the scene. Text can include HTML formatting tags h1 , strong , and em . |
type (optional) | String | Can be one of caption , sticky , and lower-third |
delay (optional) | Number | Number of seconds by which all the caption should be delayed |
multiplier (optional) | Number | Speed at which the text should be shown. See note on speed and calculation of caption duration. |
styles (optional) | Text styles object | Additional styles that should be applied to this caption. These styles will override styles specified in the theme and the scene. |
Text styles object
Key | Type | Value |
---|---|---|
captionPosition (optional) |
Position object | Custom position for the caption. This will override the position that was specified in the theme. |
layoutId (optional) |
String | Position for the caption from one of 9 positions in a grid. Allowed values are One of these 9 position for the caption. This will override the position that was specified in the theme. image-heading-top-left , image-heading-top , image-heading-top-right , image-heading-center-left , image-heading-center , image-heading-center-right , image-heading-bottom-left , image-heading-bottom , image-heading-bottom-right . |
caption-background (optional) |
String | Link to a background that should be applied to this caption. This can be an image file (JPG, JPEG, or PNG), webm file, or a link to a motion graphic file returned by the Create motion graphic API. |
textColor (optional) |
String | Custom color for the normal text of the captions. The values should be specified in hexcode, for example #FFFFFF . |
highlightColor (optional) |
String | Custom color for the highlighted text in the captions. The values should be specified in hexcode, for example #007EFF . |
backgroundColor (optional) |
String | Custom color for the background of the captions. The values should be specified in hexcode, for example #007EFF . |
fontSize (optional) |
Number | Custom font size to be provided (values will be in px, assuming the video height to be 1080px). |
font (optional) |
String | URL of custom font file to be provided (the URL must be publicly accessible, failing which the font falls back to the default font). |
Position object
Key | Type | Value |
---|---|---|
top | Integer | percentage value from 0 (topmost) to 100 (bottommost) for the right corner |
bottom | Integer | percentage value from 0 (topmost) to 100 (bottommost) for the right corner |
left | Integer | percentage value from 0 (leftmost) to 100 (rightmost) for the right corner |
right | Integer | percentage value from 0 (leftmost) to 100 (rightmost) for the right corner |
Logo Custom Position
Key | Type | Value |
---|---|---|
top | Integer | percentage value from 0 (topmost) to 100 (bottommost) for the right corner |
bottom | Integer | percentage value from 0 (topmost) to 100 (bottommost) for the right corner |
left | Integer | percentage value from 0 (leftmost) to 100 (rightmost) for the right corner |
right | Integer | percentage value from 0 (leftmost) to 100 (rightmost) for the right corner |
Scene styles object
Key | Type | Value |
---|---|---|
mediaPosition (optional) | Position object | Custom position for the media (image, video, or GIF) in the scene. This will override the position that was specified in the theme. |
overlay (optional) | String | Link to the animated overlay that should be applied to this scene. This can be a PNG file, webm file, or a link to a motion graphic file returned by the Create motion graphic API. |
transition (optional) | String | Link to the animated transition that should be applied to this scene. |
focusPoint (optional) | String | Focus the media to a particular section, one of the following values : center , top , bottom , left or right . |
sceneBackgroundColor (optional) | String | Custom background color for the scene. The values should be specified in hexcode, for example #FFFFFF . |
Response
{
"message": "successful",
"videoId": "video1234567890",
"videoUrl": "https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4"
}
The response from the API will contain a message indication successful
or error
, along with the videoId
which you can use to retrieve the video.
Error codes
The message
will contain the specified error message if the API encountered an error. The different error codes are :
message value |
Explanation |
---|---|
invalid token | The access token you specified in the header is not correct. |
you reached the limit for using this api | Every API has a limit to prevent abuse. Please contact your account manager or message on our web chat to unblock this. |
invalid user | The specified theme does not exist. |
Maximum 50 scenes can be added. Kindly delete 5 more | The number of scenes per video is limited to a max of 50. You can fix this by reducing the number of scenes to within 50. To increase this limit, please contact your account manager or message on our web chat. |
Kindly enter a media for scene : 5 | The image field is empty or absent. Every scene in a video needs a valid image or video in it. |
invalid text for scene : 5 caption : 3 | The text field has too many characters. You can fix this by reducing the number of characters to less than 300. To increase this limit, please contact your account manager or message on our web chat. |
insufficient credits | Each account has a monthly limit for the number of videos that can be created. This error is shown when the limit has been reached To increase this limit, please contact your account manager or message on our web chat. |
API - Create image
Rocketium Create image API lets you programmatically create images using images, clips, and text. The Header should contain the access token, which you generated in the previous section. If you do not have an access token, please head to Quickstart section to generate one.
import requests
url = "https://api.rocketium.com/videos"
payload = "{\n \"title\": \"Benefits of using Rocketium\",\n \"themeId\": \"599ec30b27855975ab36a1b9\",\n \"outputFormat\": \"image\",\n \"scenes\": [{\n \"text\" : \"Rocketium is easy to use\",\n \"image\" : \"https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4\"\n },\n {\n \"text\" : \"Rocketium has its own API\",\n \"image\" : \"https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4\"\n }]\n}"
headers = {
'access_token': "<YOUR_API_KEY>",
'Content-Type': "application/json"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
curl --request POST \
--url https://api.rocketium.com/videos \
--header 'Content-Type: application/json' \
--header 'access_token: <YOUR_API_KEY>' \
--data '{"title": "Benefits of using Rocketium", "themeId": "5a15310cabc5e17e6bf29525", "outputFormat": "image", "scenes": [{"text" : "Rocketium is easy to use", "image" : "https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4"}, { "text" : "Rocketium has its own API", "image" : "https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4" }]}'
var data = JSON.stringify({
"title": "Benefits of using Rocketium",
"themeId": "599ec30b27855975ab36a1b9",
"outputFormat": "image",
"scenes": [
{
"text": "Rocketium is easy to use",
"image": "https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4"
},
{
"text": "Rocketium has its own API",
"image": "https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4"
}
]
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.rocketium.com/videos");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
Make sure to replace
<YOUR_API_KEY>
with your API key along withthemeId
andscenes
data.
URL
Access the Create Video API at https://api.rocketium.com/videos
. Try in Sandbox.
HTTP Method
POST request
Headers
- Access token -
'access_token': '<YOUR_API_KEY>'
- Content type -
'Content-Type': 'application/json'
Request
Body
Key | Type | Value |
---|---|---|
scenes | Array of one Scene object | For creating image we need only one scene with media (image, video, or GIF), and captions. This field has details of the scene. |
outputFormat | String | outputFormat key to be used to specify the request type is image. |
themeId | String | ID of theme to be used to apply styles. You can get this by calling the Get Themes API. |
teamId (optional) | String | ID of workspace where the exported image should be saved. If this is not specified, the image will be available in the last workspace you have opened. Please talk to your account manager to get this ID. |
title (optional) | String | Title of the image. This will be visible in your workspace images tab. If you can't find images tab please add from store. |
logoImage (optional) | String | URL of image to be used as logo. |
metadata (optional) | JSON String or Targets array | A custom object that can be sent to be associated with this image. This entire object will be sent in the response to a webhook callback, if any. This is useful for associating image with users, products, or any other internal identifiers. If the object has an array of Share objects with the targets key, the image will be shared to the specified destinations after it has been rendered. |
draftOnly (optional) | boolean | Passing true will only create a draft in the Rocketium library but not render it as an mp4 video file. The default value is false i.e. without any input for this parameter a video will be generated and count against the 10 videos for a free user. |
id (optional) | String | The unique ID of a video returned from an earlier create API call. This can be used to make a copy of an existing video. |
orientation (optional) | String | One of landscape , square , portrait , fbCover , instagramAd |
videoBackground (optional) | String | URL of an image or video to use as the background of the entire video. This will only show up in scenes where the image does not cover the entire scene. |
Response
{
"message": "successful",
"videoId": "video1234567890"
}
The response from the API will contain a message indication successful
or error
, along with the videoId
which you can use to retrieve the image.
Error codes
The message
will contain the specified error message if the API encountered an error. The different error codes are :
message value |
Explanation |
---|---|
invalid token | The access token you specified in the header is not correct. |
you reached the limit for using this api | Every API has a limit to prevent abuse. Please contact your account manager or message on our web chat to unblock this. |
invalid user | The specified theme does not exist. |
Maximum 50 scenes can be added. Kindly delete 5 more | The number of scenes per video is limited to a max of 50. You can fix this by reducing the number of scenes to within 50. To increase this limit, please contact your account manager or message on our web chat. |
Kindly enter a media for scene : 5 | The image field is empty or absent. Every scene in a video needs a valid image or video in it. |
invalid text for scene : 5 caption : 3 | The text field has too many characters. You can fix this by reducing the number of characters to less than 300. To increase this limit, please contact your account manager or message on our web chat. |
insufficient credits | Each account has a monthly limit for the number of videos that can be created. This error is shown when the limit has been reached To increase this limit, please contact your account manager or message on our web chat. |
API - Get video
Once your video is created, you can easily retrieve it with a simple API call.
import requests
url = "https://api.rocketium.com/videos/<ID>"
payload = ""
headers = {
'access_token': "<YOUR_API_KEY>",
'Content-Type': "application/json"
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
curl "https://api.rocketium.com/videos/<ID>" --header "access_token: <YOUR_API_KEY>"
var data = JSON.stringify(false);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.rocketium.com/videos/<ID>");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
Make sure to replace
<YOUR_API_KEY>
with your API key along with<id>
with your video Id.
URL
Access the Retrieve video API here: https://api.rocketium.com/videos/<id>
. Try in Sandbox
Method
GET Request
Headers
- Access token -
'access_token': '<YOUR_API_KEY>'
Request
URL parameter
- ID -
id
: ID of the video you want to retrieve. This is the same as thevideoId
field returned in the response of the Create Video API.
Response
{
"message": "successful",
"url": "https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4"
}
The response from the API will contain a message indication successful
, in_progress
or error
. If the message was successful
the response will have the url
which you can use to access the video. If the message was in_progress
the response will have progress
indicating the progress in generating the video.
API - Get image
Once your image is created, you can easily retrieve it with a simple API call.
import requests
url = "https://api.rocketium.com/videos/<ID>"
payload = ""
headers = {
'access_token': "<YOUR_API_KEY>",
'Content-Type': "application/json"
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
curl "https://api.rocketium.com/videos/<ID>" --header "access_token: <YOUR_API_KEY>"
var data = JSON.stringify(false);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.rocketium.com/videos/<ID>");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
Make sure to replace
<YOUR_API_KEY>
with your API key along with<id>
with your video Id.
URL
Access the Retrieve video API here: https://api.rocketium.com/videos/<id>
. Try in Sandbox
Method
GET Request
Headers
- Access token -
'access_token': '<YOUR_API_KEY>'
Request
URL parameter
- ID -
id
: ID of the video you want to retrieve. This is the same as thevideoId
field returned in the response of the Create Video API.
Response
{
"message": "successful",
"url": "https://dev.rocketium.com/images/export/5d259f8f3df88447996abd2b/1562746771913.png",
"screenshots": [
"https://dev.rocketium.com/images/export/5d259f8f3df88447996abd2b/1562746771913.png"
]
}
The response from the API will contain a message indication successful
, in_progress
or error
. If the message was successful
the response will have the url
which you can use to access the image. If the message was in_progress
the response will have progress
indicating the progress in generating the image.
API - Create motion graphic
Rocketium Create motion graphic API lets you programmatically create motion graphics like overlays, transitions, and caption backgrounds using images and clips.
import requests
url = "https://api.rocketium.com/motion-graphics"
payload = "{\n \"asset\": \"https://mysite.com/assets/purple-cut-out-overlay.png\",\n \"type\": \"overlay\",\n \"orientation\": \"landscape\",\n \"loop\": \"true\"\n}"
headers = {
'access_token': "<YOUR_API_KEY>",
'Content-Type': "application/json"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
curl --request POST \
--url https://api.rocketium.com/motion-graphics \
--header 'Content-Type: application/json' \
--header 'access_token: <YOUR_API_KEY>' \
--data '{\n "asset": "https://mysite.com/assets/purple-cut-out-overlay.png",\n "type": "overlay",\n "orientation": "landscape",\n "loop": "true"\n}'
var data = JSON.stringify({
"asset": "https://mysite.com/assets/purple-cut-out-overlay.png",
"type": "overlay",
"orientation": "landscape",
"loop": "true"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.rocketium.com/motion-graphics");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
Make sure to replace
<YOUR_API_KEY>
with your API key.
URL
Access the Create Video API at https://api.rocketium.com/motion-graphics
.
HTTP Method
POST request
Headers
- Access token -
'access_token': '<YOUR_API_KEY>'
- Content type -
'Content-Type': 'application/json'
Request
Body
Key | Type | Value |
---|---|---|
asset | String | Every motion graphic element is created from an existing asset. We support PNG and webm files. Pass a publicly-accessible link to the asset file. |
type | String | Type of motion graphic to create. Allowed values are overlay and caption-background . |
orientation (optional) | String | Orientation of the motion graphic. Allowed values are landscape , square , portrait , fbCover , instagram . |
loop (optional) | Boolean | Specify if the overlay should loop after it finishes playing or freeze after reaching the end. |
size (optional) | Boolean | Specify if the caption-background should fit/fill inside the container. Allowed values are fit , fill , stretch . |
Response
This API might take up to 5 seconds as it involves rendering the asset into a motion graphic element.
{
"message": "successful",
"url": "https://rocketium.com/video_effects/videos/1234567890.webm"
}
Error codes
The message
will be error
if the API encountered an error. Details of the error will be in the details
field. Possible values for this field are below.
details value |
Explanation |
---|---|
missing-asset | No asset URL specified in the request |
missing-type | No type specified in the request |
asset-inaccessible | Asset is not accessible |
asset-invalid | Asset is not a PNG or webm file |
orientation-invalid | Asset is not one of landscape , square , portrait , fbCover , instagram |
loop-invalid | loop is not one of true and false |
API - Share
Rocketium Share API lets you programmatically share videos, GIFs, or images to social, cloud storage, and advertising platforms.
import requests
url = "https://api.rocketium.com/share"
payload = "{ \"videoId\": \"<Video ID>\", \"targets\": [\n {\n \"platform\": \"facebook\",\n\t\"page-id\": \"1637158723183379\",\n\t\"description\": \"This is an overview video of Citadel Corp.\",\n\t\"publish-at\": \"2019-03-12T08:34:37.621Z\",\n\t\"title\": \"Citadel Corp overview\",\n\t\"thumbnail\": \"http://citadel.com/images/thumbnail.jpg\",\n\t\"media\": \"http://citadel.com/videos/overview.mp4\"\n },\n {\n \"platform\": \"youtube\",\n\t\"channel-id\": \"UCvtl87vJeCZfQO7HaKzLpfw\",\n\t\"description\": \"This is an overview video of Citadel Corp.\",\n\t\"title\": \"Citadel Corp overview\",\n\t\"tags\": [\"Citadel\", \"corporate\"],\n\t\"visibility\": \"public\",\n\t\"thumbnail\": \"http://citadel.com/images/thumbnail.jpg\",\n\t\"media\": \"http://citadel.com/videos/overview.mp4\"\n }\n]\n}"
headers = {
'access_token': "<YOUR_API_KEY>",
'Content-Type': "application/json",
'cache-control': "no-cache",
'Postman-Token': "d00d2983-aec9-4c63-8397-f69f4a4576ea"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
curl --request POST \
--url https://api.rocketium.com/share \
--header 'Content-Type: application/json' \
--header 'Postman-Token: 35efbc24-268b-4f7c-8d1b-65c29a26c6f5' \
--header 'access_token: <YOUR_API_KEY>' \
--header 'cache-control: no-cache' \
--data '{ "videoId": "<Video ID>", \n"targets": [\n {\n "platform": "facebook",\n "page-id": "1637158723183379",\n "description": "This is an overview video of Citadel Corp.",\n "publish-at": "2019-03-12T08:34:37.621Z",\n "title": "Citadel Corp overview",\n "thumbnail": "http://citadel.com/images/thumbnail.jpg",\n "media": "http://citadel.com/videos/overview.mp4"\n },\n {\n "platform": "youtube",\n "channel-id": "UCvtl87vJeCZfQO7HaKzLpfw",\n "description": "This is an overview video of Citadel Corp.",\n "title": "Citadel Corp overview",\n "tags": ["Citadel", "corporate"],\n "visibility": "public",\n "thumbnail": "http://citadel.com/images/thumbnail.jpg",\n "media": "http://citadel.com/videos/overview.mp4"\n }\n] \n}'
var data = JSON.stringify({
"videoId": "<Video ID>",
"targets": [
{
"platform": "facebook",
"pageId": "1637158723183379",
"description": "This is an overview video of Citadel Corp.",
"publishAt": "2019-03-12T08:34:37.621Z",
"title": "Citadel Corp overview"
},
{
"platform": "youtube",
"description": "This is an overview video of Citadel Corp.",
"title": "Citadel Corp overview",
"tags": [
"Citadel",
"corporate"
],
"visibility": "public",
"thumbnail": "http://citadel.com/images/thumbnail.jpg"
}
]
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.rocketium.com/share");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("cache-control", "no-cache");
xhr.setRequestHeader("Postman-Token", "beb64f70-4ffe-403a-89c9-0d7f64194691");
xhr.send(data);
Make sure to replace
<YOUR_API_KEY>
with your API key.
URL
Access the Share API at https://api.rocketium.com/share
.
HTTP Method
POST request
Headers
- Access token -
'access_token': '<YOUR_API_KEY>'
- Content type -
'Content-Type': 'application/json'
Request
Body
Key | Type | Value |
---|---|---|
videoId | String | ID of the video you want to retrieve. This is the same as the videoId field returned in the response of the Create Video API. |
targets | Array of Share objects | An array of objects representing individual shares. |
Share object
Key | Type | Value |
---|---|---|
platform | String | Platform where the media should be shared. Allowed values are facebook-page and youtube . |
pageId | String | ID of the page to which image or video should be shared. Only applicable when platform is facebook-page . |
description | String | Text description of the media. Can contain emoji. 🎉 |
publishAt (optional) | String | Time when the image or video should be published. Should be specified in the ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. Only applicable when platform is facebook-page . |
title | String | Text description of the media. Can contain emoji. 🎉 |
thumbnail (optional) | String | Publicly accessible link to an image to be shown as thumbnail. Only applicable when platform is youtube . |
tags | Array of String | Keywords for the video that help in discovery by users. Only applicable when platform is youtube . |
visibility | String | Controls who can see the video. Allowed values are public , private , and unlisted . Only applicable when platform is youtube . |
Response
{
"message": "successful",
"details": "Your video was shared successfully to Youtube"
}
Error codes
The message
will be error
if the API encountered an error. Details of the error will be in the details
field. Possible values for this field are below.
details value |
Explanation |
---|---|
platform-invalid | platform is not one of facebook-page and youtube |
access-invalid | The account does not have access to the specified page or channel |
asset-inaccessible | Asset is not accessible |
asset-invalid | Asset is not a PNG or webm file |
visibility-invalid | visibility is not one of private , public , unlisted |
API - Get themes
This API returns themes associated with your account and public themes available to all users.
import requests
url = "https://api.rocketium.com/api/v2/themes"
payload = ""
headers = {
'access_token': "<YOUR_API_KEY>",
'Content-Type': "application/json"
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
curl --request GET \
--url https://api.rocketium.com/api/v2/themes \
--header 'Content-Type: application/json' \
--header 'access_token: <YOUR_API_KEY>'
var data = JSON.stringify(false);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.rocketium.com/api/v2/themes");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
Make sure to replace
<YOUR_API_KEY>
with your API key.
URL
Access the Retrieve themes API here: https://api.rocketium.com/api/v2/themes
Method
GET Request
Headers
- Access token -
'access_token': '<YOUR_API_KEY>'
Request
Query parameters
- Workspace ID -
teamId
(optional): If this is not specified, only themes available in every workspace will be returned. If a valid value is specified, themes from the given workspace will also be returned in addition to common themes. Please talk to your account manager to get this ID.
Available Public Themes
Rocketium users get access to public themes designed for many use cases. Both public themes and your own private themes are returned when you call this API. In the sandbox the below mentioned theme IDs can be used for testing.
Example theme name | Theme ID | Theme preview |
---|---|---|
Insider | 5a15310cabc5e17e6bf29525 | Link |
Elegant Green | 599ec30b27855975ab36a1b9 | Link |
Chalkboard | 5a0ab21aabc5e17e6bf28c2b | Link |
API - Get themes v3
This API returns themes associated with your account and public themes available to all users.
import requests
url = "https://api.rocketium.com/api/v3/getThemes"
payload = ""
headers = {
'access_token': "<YOUR_API_KEY>",
'Content-Type': "application/json"
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
curl --request GET \
--url https://api.rocketium.com/api/v3/getThemes \
--header 'Content-Type: application/json' \
--header 'access_token: <YOUR_API_KEY>'
var data = JSON.stringify(false);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.rocketium.com/api/v3/getThemes");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
Make sure to replace
<YOUR_API_KEY>
with your API key.
URL
Access the Retrieve themes API here: https://api.rocketium.com/api/v3/getThemes
Method
GET Request
Headers
- Access token -
'access_token': '<YOUR_API_KEY>'
Request
Query parameters
- Workspace ID -
teamId
(optional): If this is not specified, only themes available in every workspace will be returned. If a valid value is specified, themes from the given workspace will also be returned in addition to common themes. Please talk to your account manager to get this ID. - Filter -
filter
(optional): If this is not specified, both public and private themes will be returned. If a valid value is specified, appropriate filter will be applied. Filter can bePUBLIC
orPRIVATE
, if no filter is provided both public and private are returned.
Available Public Themes
Rocketium users get access to public themes designed for many use cases. Both public themes and your own private themes are returned when you call this API. In the sandbox the below mentioned theme IDs can be used for testing.
Example theme name | Theme ID | Theme preview |
---|---|---|
Insider | 5a15310cabc5e17e6bf29525 | Link |
Elegant Green | 599ec30b27855975ab36a1b9 | Link |
Chalkboard | 5a0ab21aabc5e17e6bf28c2b | Link |
API - Get templates
This API returns templates associated with your account and public templates available to all users.
import requests
url = "https://api.rocketium.com/api/v3/getTemplates"
payload = ""
headers = {
'access_token': "<YOUR_API_KEY>",
'Content-Type': "application/json"
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
curl --request GET \
--url https://api.rocketium.com/api/v3/getTemplates \
--header 'Content-Type: application/json' \
--header 'access_token: <YOUR_API_KEY>'
var data = JSON.stringify(false);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.rocketium.com/api/v3/getTemplates");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
Make sure to replace
<YOUR_API_KEY>
with your API key.
URL
Access the Retrieve themes API here: https://api.rocketium.com/api/v3/getTemplates
Method
GET Request
Headers
- Access token -
'access_token': '<YOUR_API_KEY>'
Request
Query parameters
- Workspace ID -
teamId
(optional): If this is not specified, public templates will be returned. If a valid value is specified, templates from the given workspace will also be returned in addition to public templates. Please talk to your account manager to get this ID. - filter -
filter
(optional): If this is not specified, both public and private templates will be returned. If a valid value is specified, appropriate filter will be applied. Filter can bePUBLIC
orPRIVATE
, if no filter is provided both public and private are returned.
Available Public Themes
Rocketium users get access to public templates designed for many use cases. Both public templates and your own private templates are returned when you call this API. In the sandbox the below mentioned theme IDs can be used for testing.
Example Template Name | _ID | Template preview |
---|---|---|
Insider | 5a15310cabc5e17e6bf29525 | Link |
Elegant Green | 599ec30b27855975ab36a1b9 | Link |
Chalkboard | 5a0ab21aabc5e17e6bf28c2b | Link |
API - Get template
This API returns detailed information of a single template which you requested
import requests
url = "https://api.rocketium.com/api/v1/template/<template_id>"
payload = ""
headers = {
'access_token': "<YOUR_API_KEY>",
'Content-Type': "application/json"
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
curl --request GET \
--url https://api.rocketium.com/api/v1/template/{template_id} \
--header 'Content-Type: application/json' \
--header 'access_token: <YOUR_API_KEY>'
var data = JSON.stringify(false);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.rocketium.com/api/v1/template/<template_id>");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
Make sure to replace
<YOUR_API_KEY>
with your API key along withtemplate_id
URL
Access the get template API here: https://api.rocketium.com/api/v1/template/<template_id>
Method
GET Request
Headers
- Access token -
'access_token': '<YOUR_API_KEY>'
Request
Query parameters
- Advanced template share code -
advancedCodeGen
(optional): If this is not specified to true, basic version of template share code will be returned.
API - Stock Content Search
Rocketium Stock Content Search API allows you to search millions of stock images and clips.
import requests
url = "https://api.rocketium.com/stock-content-search"
querystring = {"query":"summer"}
payload = ""
headers = {
'access_token': "<YOUR_API_KEY>",
'Content-Type': "application/json"
}
response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
print(response.text)
curl --request GET \
--url 'https://api.rocketium.com/stock-content-search?query=summer' \
--header 'Content-Type: application/json' \
--header 'access_token: <YOUR_API_KEY>'
var data = JSON.stringify(false);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.rocketium.com/stock-content-search?query=summer");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
Make sure to replace
<YOUR_API_KEY>
with your API key.
URL
Access the Stock Content Search API at https://api.rocketium.com/stock-content-search
.
Method
GET Request
Request
Query parameters
Parameter | Value |
---|---|
query | Search query |
media-type (optional) | Type of media that you want. Can be one of image and video . By default only images will be returned. |
page-number (optional) | Results will be paginated into 20 results at a time. To fetch subsequent results, pass the appropriate page number. |
included-sources (optional) | Comma-separated list of sources that should be queried to get the images or videos. Allowed values are pexels , pixabay , unsplash , flickr , and storyblocks . |
Response
{
"message": "successful",
"images": [{
"thumbnail": "https://videoblocks.com/barbells-in-gym.jpg",
"url": "https://videoblocks.com/barbells-in-gym.mp4",
"title": "Rows of metal heavy hand barbells on rack in modern gym.",
"source": "VideoBlocks",
"source_url": "https://api.videoblocks.com/video/barbells-in-gym",
"user": "videoblocks",
"videoId": 12345,
"tags": [ "activity", "barbell", "bodybuilding", "close up" ]
},
{...}],
"page-number": 1
}
Parameter | Type | Value |
---|---|---|
message | String | Will be either successful or error |
images | Array of Search result objects | Images returned by the API |
Search result object
Key | Type | Value |
---|---|---|
thumbnail | String | Thumbnail image URL that can be used for preview |
url | String | URL that can be used to download the image or video |
title | String | Title of the image or video |
source | String | Source of the image or video. Some sources require attribution of the creator |
source_url | String | Original URL of the image or video |
user | String | Name of the creator of the image or video |
userName | String | Username of the creator of the image or video |
videoId (only for video) | String | Internal identifier for the video that should be used to download the video |
tags (only for video) | Array of String | Tags related to the video |
API - Search
Rocketium Search API allows you to find images and videos in your workspaces.
import requests
url = "https://api.rocketium.com/search"
querystring = {"workspaceID": "my-workspace-12345", "query": "summer"}
payload = ""
headers = {
'access_token': "<YOUR_API_KEY>",
'Content-Type': "application/json"
}
response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
print(response.text)
curl --request GET \
--url 'https://api.rocketium.com/search?workspaceID=my-workspace-12345&query=summer' \
--header 'Content-Type: application/json' \
--header 'access_token: <YOUR_API_KEY>'
var data = JSON.stringify(false);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.rocketium.com/search?workspaceID=my-workspace-12345&query=summer");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
Make sure to replace
<YOUR_API_KEY>
with your API key.
URL
Access the Search API at https://api.rocketium.com/search
.
Method
GET Request
Request
Query parameters
Parameter | Value |
---|---|
query (optional) | Search query to find images and videos. The API will look through titles, tags, and metadata fields of images and videos to find the matches. |
media-type (optional) | Type of media that you want. Can be one of image and video . By default both images and videos will be returned. |
workspaceID (optional) | ID of the workspace where you want to search for images or videos. Your account manager or customer support team can share this with you. |
page-number (optional) | Results will be paginated into 20 results at a time. To fetch subsequent results, pass the appropriate page number. |
is-published (optional) | Show only published video, defaults to false , allowed values are true or false . |
Response
{
"message": "successful",
"results": [{
"id": "12345",
"workspaceID": "7890",
"thumbnail": "https://rocketium.com/thumbnail/summer-stories.jpg",
"url": "https://rocketium.com/download/summer-stories.mp4",
"title": "Summer Stories",
"type": "video",
"tags": "summer,stories,portrait,instagram",
"metadata": {"userID": "12345", "pageID": "abcde", "productID": "qwerty"}
},
{...}],
"page-number": 1
}
Parameter | Type | Value |
---|---|---|
message | String | Will be either successful or error |
results | Array of Search objects | Images or videos returned by the API |
Search object
Key | Type | Value |
---|---|---|
id | String | Unique ID of the image or video |
workspaceId | String | ID of the workspace where the image or video exists |
thumbnail | String | Thumbnail image URL that can be used for preview |
url | String | URL that can be used to download the image or video |
title | String | Title of the image or video |
type | String | One of image or video |
tags | String | Comma-separated tags that are specified when creating the image or video |
metadata | Object | Key-value pairs that are specified when creating the image or video |
page-number | String | Results will be paginated into 20 results at a time. This field specifies the page number of the current results. |
API - Text-to-speech
Rocketium text-to-speech API allows you to create natural-sounding voice-overs for use in your videos using text.
import requests
url = "https://api.rocketium.com/speech"
payload = "{\n \"text\": \"Rocketium is easy to use\",\n \"voice\": \"uk-female1\"\n}"
headers = {
'access_token': "<YOUR_API_KEY>",
'Content-Type': "application/json"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
curl --request POST \
--url https://api.rocketium.com/speech \
--header 'Content-Type: application/json' \
--header 'access_token: <YOUR_API_KEY>' \
--data '{\n "text": "Rocketium is easy to use",\n "voice": "uk-female1"\n}'
var data = JSON.stringify({
"text": "Rocketium is easy to use",
"voice": "uk-female1"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.rocketium.com/speech");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
Make sure to replace
<YOUR_API_KEY>
with your API key.
Method
POST Request
Headers
- Access token -
'access_token': '<YOUR_API_KEY>'
- Content type -
'Content-Type': 'application/json'
Request
Body
Key | Type | Value |
---|---|---|
text | String | Text to convert automatically to speech |
voice | String | Voice in which the voice should speak. Supported values are - in-female1 , us-female1 , us-male1 , uk-female1 , uk-male1 . |
Response
{
"message": "successful",
"url": "https://rocketium.com/textToSpeech/abcd_speech.mp3"
}
The response from the API will contain a message indication successful
or error
, along with the url
containing the link to the voice-over audio.
API - Create Workspace
Can create workspace using this api.
import requests
url = "https://api.rocketium.com/workspaces"
payload = "{\n \"name\": \"my new workspace\"\n}"
headers = {
'access_token': "<YOUR_API_KEY>",
'Content-Type': "application/json"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
curl --request POST \
--url https://api.rocketium.com/workspaces \
--header 'Content-Type: application/json' \
--header 'access_token: <YOUR_API_KEY>' \
--data '{\n "name": "my new workspace"\n }'
var data = JSON.stringify({
name: 'my new workspace'
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.rocketium.com/workspaces");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
Make sure to replace
<YOUR_API_KEY>
with your API key along with<id>
with your video Id.
URL
Create workspace API here: https://api.rocketium.com/workspaces
.
Method
POST Request
Headers
- Access token -
'access_token': '<YOUR_API_KEY>'
Request
Body
Key | Type | Value |
---|---|---|
name | String | Every workspace needs a name to be identifiable. |
Response
{
"message": "successful",
"id": "<workspace id>",
"shortId": "<workspace short id>"
}
The response from the API will contain a message indication successful
, invalid team name
, invalid user
or limit reached
. If the message was successful
the response will have the id
which you can use as workspace id.
Webhook Payload
{
"videoUrl" : "https://rocketium.com/video-download-url-goes-here",
"videoId": "uniqueVideoId",
"videoName" : "Name of your video",
"metadata" : {
"key": "metadata passed to create api during video creation"
}
}
- To add a webhook URL to your account, you need to contact us(by clicking on the blue chat icon to the bottom right of your screen).
Rocketium Button - white-label video creator
Rocketium Button is an HTML5 library that adds Rocketium's powerful video creator to your website. The script loads asynchronously and does not slow down your website. You can control the look-and-feel of Rocketium Button or even hide and invoke it programmatically. You can control the user experience within Rocketium by making only certain features available to them. Rocketium's editor opens in a lightbox when a user clicks on Rocketium Button.
Quickstart
<script>
(function () {
window.rfsdk = window.rfsdk || function () {
(window.rfsdk.q = window.rfsdk.q || []).push(arguments);
};
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = 'https://rocketium.com/js/rfsdk.min.js';
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
})();
window.rfsdk('init', {
'entry-point': 'template-selection',
'workspaceId': '<workspace-where-you-want-videos-to-be-saved>',
'templateId': '<video-template-that-should-be-opened-by-the-editor>',
'clientId': '<unique-identifier-for-your-account>',
'appendTo': '<id-of-div-to-which-the-button-should-be-added>'
});
</script>
Step 1. Set up your account
Create a new Rocketium account and contact our customer support by clicking the blue icon at the bottom right of your screen. They will share the workspace and client IDs that you need in your script. The client ID will only work with the domains that you whitelist so make sure you share those with the support team. You can always add or remove domains later without needing to update your website code.
Step 2. Create templates
You can save any video in Rocketium's video creator as a template. Once you export your template video, you can go to the Code tab within the Share settings of that video to get the template ID.
Step 3. Add Rocketium Button to your website
Paste the code snippet on the right after the <body>
tag of your website. Make sure you put the right values for workspaceId
, templateId
, clientId
, and appendTo
.
Step 4. Handle client-side (recommended) and server-side (optional) events
Rocketium Button fires events for important lifecycle events. The most important of these is when the video is exported. Handle this to show a loader or success message to users once they finish their video. Once the video is ready to be downloaded, Rocketium will call your configured webhook. You can download the video using the link in the webhook and use it in your application.
Configuration
The following options can be configured for Rocketium Button.
window.rfsdk('init', {
'entry-point': 'editor'
'workspaceId': '<workspace-id-here>',
'templateId': '<template-id-here>',
'clientId': '<client-id-here>',
'appendTo': 'app',
'preview': 'full',
'layout': true,
'media-library': false,
'stock-library': true,
'media-upload': false,
'button-text': 'Make video with Rocketium',
'button-image': 'https://rocketium.com/img/logo400x400.png',
'button-color': '#007eff',
'video-name': 'Rocketium Button Test Video',
'template-config': {
tags: ['social', 'memes'],
orientations: ['landscape', 'portrait'],
visibility: 'private' // can be 'private', 'public', 'both'
}
});
Key | Type | Value |
---|---|---|
entry-point | String | Entry point of rfsdk, Default value is editor , can be editor or template-selection . |
editor-type | String | Defines how the editor will open. There are two possible values for this inline and popup . Default is popup . |
export-type | String | Video should be published or saved as draft. Default value is generate . Can be generate or draft . |
workspaceId | String | ID of the workspace where you want videos to be saved. Your account manager or customer support team can share this with you. |
templateId | String | ID of the template that should be opened by the editor. Once you export your template video, you can go to the Code tab within the Share settings of that video to get the template ID. |
clientId | String | Unique identifier for your account. Your account manager or customer support team can share this with you. |
appendTo | String | ID of the div to which the button should be added |
layout | Boolean | Controls whether users can browse and choose individual layouts for every scene they add. Default value is true . |
media-library | Boolean | Controls whether users can access past images, videos, and music uploaded to your account. Default value is false . |
show-Workspacelevel-Media | Boolean | if set to true displays the media library assets at workspace level. default user level media assets will be shown. |
stock-library | Boolean | Controls whether users can search Rocketium's stock footage and image library. Default value is true . |
media-upload | Boolean | Controls whether users can upload images and videos. Default value is true . |
preview | String | Controls the features available to users in the preview. Can be either of off , basic or full . If off is chosen, users will not see a preview of the video. If basic is chosen, users will only be able to change video-level settings such as music and logo. If full is chosen, users will be able to choose from 30+ styling categories like fonts, colors, animations, and more. Default value is basic . |
button-text | String | Text shown on the button |
button-image | String | Image shown on button |
button-color | String | Color of the button |
button-hidden | Boolean | Controls if the button should be hidden at launch. Default value is false . Set this to true if you want to trigger opening Rocketium editor programmatically. |
editor-button-text | String | text shown on the editor button. default will be Export . |
export-and-close | Boolean | if set to true closes the editor after export. If set to false won't close the editor after export. |
export-setting | Boolean | Controls whether export setting options to be shown or not. Default value is false . |
fullHd | Boolean | Controls whether users see 1080p as an export option in export settings. Default value is false . |
export-quality | String | Quality of the exported video. Can be full-hd , hd , or sd . Default value is hd . Note: Ensure export-setting is false when setting export-quality so users will not be able to select export quality inside the editor. |
hide-export-button | String | Controls whether export video button to be shown or not. Default value is false . |
video-name | String | Name of the video. This will be name for the video in the Rocketium dashboard. |
metadata | Object | Custom information about the video that you can pass. |
template-config | Object | Template config object. |
layout-panes | String | What layout panes to show, Applies if layout is set to true . Default value is both . Can be all-scenes , my-scenes or both . |
layout-visibility | String | Wether to show private , public , or both in layout pane, Applies if layout is set to true . Default value is both . Can be public , private or both . |
custom-media-search | Object | media-search-object allows Rocketium to fetch tagged media links from client servers and show them inside Rocketium's media library.. |
media-search-config
"custom-media-search": {
url: "api end point to be called"
"user-id":"<id to fetch media>"
"request-headers":"any auth headers if required"
}
Parameter | Value |
---|---|
url | The API endpoint URL that need to be called for fetching the links [GET method]. The client needs to provide this to Rocketium. The url should not end in "/" |
user-id | Any custom tag to be queried, that the media assets are tagged with. |
request-headers | Any other parameters that need to be passed to make the query. Example- authorization token |
template-config
'template-config': {
tags: ['social'], // can be array of tags to search for. If none is specified, all videos are shown.
orientations: ['landscape', 'portrait', 'square'], // supported values, 'landscape', 'portrait', 'square', 'facebook'. if none is specified a dropdown to filter orientations is provided.
visibility: 'private', // "private", "public" or "both", default is both, if none is specified, default is used.
templateIds:['< templateIds >'] //array of templateids to be shown to user, if none is specified all templates will be shown.
}
Parameter | Value |
---|---|
tags | Array of tags to filter by, e.g ['social', 'memes'] |
orientations | Orientations to filter by e.g ['landscape'] |
visibility | Choose wether to show public , private or both templates |
templateIds | Array of template ids to be shown. e.g ['5c6d28e90783db785ca7532b'] |
Supported browsers
Rocketium's video editor relies on cutting-edge browser features. It is currently supported only on the browsers listed below. Write to us at contact@rocketium.com if you want support for more browsers. - Google Chrome - Firefox
Events
<script>
window.rfsdk('on', 'rfsdk-editor-loading', function() {
// Do something here.
});
window.rfsdk('on', 'rfsdk-editor-ready', function() {
// Do something here.
});
window.rfsdk('on', 'rfsdk-video-exporting', function() {
// Do something here.
});
window.rfsdk('on', 'rfsdk-video-exported', function(data) {
// Do something here.
});
window.rfsdk('on', 'rfsdk-template-selection-loading', function() {
// Do here
});
window.rfsdk('on', 'rfsdk-template-selection-ready', function() {
// Do here
});
</script>
Following events can be listened for using the sample code provided on the right.
Event name | Details | Attributes |
---|---|---|
rfsdk-editor-loading |
Rocketium's editor is loading | None |
rfsdk-editor-ready |
Rocketium's editor is ready to be used by the user | videoId and videoShortId are returned in the data object of the callback. |
rfsdk-video-exporting |
User clicks on the Export button in Rocketium's editor. If there is an event handler for this event, the video will not be exported until the export method is called. |
The attributes object will contain videoDuration that specifies the duration of the video. |
rfsdk-video-exported |
Rocketium's servers have received the request to render the video. The editor will auto-close at this point. | Data related to exported video is returned (downloadUrl and other metadata). |
rfsdk-template-selection-loading |
Rocketium's template selection screen is loading | None |
rfsdk-template-selection-ready |
Rocketium's template selection screen is ready to be used. | None |
Error Codes
<script>
window.rfsdk('on', 'rfsdk-error', function(data) {
// Do something with data.errorCode and data.errorMessage.
});
</script>
Following are the error codes you might encounter while trying to setup Rocketium Form SDK on your webpage.
You can register to recieve error events using the code snippet at the right
Error code | Details | Troubleshooting |
---|---|---|
RFSDK_MISSING_CONFIG | Required parameters are missing | Missing parameters will be emitted to the console. Update the script to add these entries. |
RFSDK_INVALID_CONFIG | One or more parameters are invalid | Invalid parameters will be emitted to the console. Update the script to fix these entries. |
RFSDK_OUT_OF_CREDITS | Your account does not have any more video credits. | Get in touch with your account manager or our support team. |
RFSDK_INVALID_CLIENT_ID_OR_DOMAIN_NOT_WHITELISTED | The client ID is invalid or the domain on which Rocketium Button is running has not been whitelisted. | Check the client ID shared by the Rocketium team and ensure the current domain has been whitelisted. |
RFSDK_INVALID_TEMPLATE_ID | The specified template ID is either invalid or unavailable for your account. | Correct the template ID sent while initialising. |
RFSDK_INVALID_WORKSPACE_ID | The specified workspace ID is either invalid or unavailable for your account. | Correct the workspace ID sent while initialising. |
{
errorCode : String - Error code from above
errorMessage: String - Error message
}
Methods
Rocketium Button can be controlled with Javascript.
Method | Details |
---|---|
init |
Initialise or change Rocketium Button configuration. This will not open Rocketium's editor. This is already a part of the sample script and does not need to be called again. |
openEditor |
This will open Rocketium's editor with the configured parameters. The editor opens automatically when a user clicks on the button. You need to call this method only if you want to hide the default button and open the editor based on user interaction on your site. |
openVideo |
When called this method will open Rocketium's editor with the given videoId. If you want to edit a video which is created previously, call this method and pass videoId as parameter. |
showButton |
This will show the Rocketium Button. You need to call this method only if you had previously hidden it. |
hideButton |
This will hide the Rocketium Button. You need to call this method only if you want to hide the default button and open the editor based on user interaction on your site. |
loadTemplate |
Once editor init method is called you can use loadTemplate to load any template accessible to you or a public template, loadTemplate accepts templateId as a parameter. Failing to provide a templateId to loadTemplate will result in creation of a blank video. |
updateConfig |
Instead of calling init again, you can use updateConfig to update configuration values at run time, changing config will be immediately reflected in editor. |
openTemplateSelection |
Accepts a Template Config object as a parameter. |
save |
This will save the current video. |
generateVideo |
This will generate the video. |
window.rfsdk('openVideo', <videoId>);