Add & Stream Video content
curl --request POST \
--url https://api.videograph.ai/video/services/api/v1/contents \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"content": [
{
"url": "https://d19nx8bm4jzw4h.cloudfront.net/Tears-of-steel.mp4"
}
],
"playback_policy": [
"public"
],
"title": "Demo Video"
}
'
const sdk = require('api')('@videograph/v1.0#4ac1hlcq4cun5');
sdk.auth('APITOKEN', 'SECRETKEY');
sdk.postVideoServicesApiV1Contents({
content: [{url: 'https://d19nx8bm4jzw4h.cloudfront.net/Tears-of-steel.mp4'}],
playback_policy: ['public'],
title: 'Demo Video'
})
.then(({ data }) => console.log(data))
.catch(err => console.error(err));
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.videograph.ai/video/services/api/v1/contents', [
'body' => '{"content":[{"url":"https://d19nx8bm4jzw4h.cloudfront.net/Tears-of-steel.mp4"}],"playback_policy":["public"],"title":"Demo Video"}',
'headers' => [
'accept' => 'application/json',
'authorization' => 'Basic APITOKEN',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
import requests
url = "https://api.videograph.ai/video/services/api/v1/contents"
payload = {
"content": [{"url": "https://d19nx8bm4jzw4h.cloudfront.net/Tears-of-steel.mp4"}],
"playback_policy": ["public"],
"title": "Demo Video"
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"authorization": "Basic APITOKEN"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"content\":[{\"url\":\"https://d19nx8bm4jzw4h.cloudfront.net/Tears-of-steel.mp4\"}],\"playback_policy\":[\"public\"],\"title\":\"Demo Video\"}");
Request request = new Request.Builder()
.url("https://api.videograph.ai/video/services/api/v1/contents")
.post(body)
.addHeader("accept", "application/json")
.addHeader("content-type", "application/json")
.addHeader("authorization", "Basic APITOKEN")
.build();
Response response = client.newCall(request).execute();
After posting the content creation request successfully. You will receive an API response with Content ID and Playback ID along with Status saying “Preparing” or “Ready”
{
"code": 200,
"data": {
"contentId": "fa6d3dc8-c78c-4c67-98ef",
"created_at": 1673353801033,
"description": "",
"duration": 0,
"metadata": [],
"mp4_support": true,
"playbackPolicy": [
"public"
],
"save_original_copy": false,
"status": "Pending",
"statusId": 1,
"test_video": true,
"title": "Demo Video"
},
"message": "Data success",
"status": "Success"
}
curl --request GET \
--url https://api.videograph.ai/video/services/api/v1/contents/CONTENT_ID \
--header 'accept: application/json' \
--header 'authorization: Basic APITOKEN'
const sdk = require('api')('@videograph/v1.0#4ac1hlcq4cun5');
sdk.auth('APITOKEN', 'SECRETKEY');
sdk.getVideoServicesApiV1ContentsContent_id({CONTENT_ID: 'CONTENT_ID'})
.then(({ data }) => console.log(data))
.catch(err => console.error(err));
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.videograph.ai/video/services/api/v1/contents/CONTENT_ID', [
'headers' => [
'accept' => 'application/json',
'authorization' => 'Basic APITOKEN',
],
]);
echo $response->getBody();
import requests
url = "https://api.videograph.ai/video/services/api/v1/contents/CONTENT_ID"
headers = {
"accept": "application/json",
"authorization": "Basic APITOKEN"
}
response = requests.get(url, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.videograph.ai/video/services/api/v1/contents/CONTENT_ID")
.get()
.addHeader("accept", "application/json")
.addHeader("authorization", "Basic APITOKEN")
.build();
Response response = client.newCall(request).execute();
Updated over 1 year ago