API v1 (deprecated)

Categories

 

Retrieve Category By PID

Returns categories by PID, group token and publisher id are required. This method returns 50 results by page.

Type Request: GET

URL: https://api.vodgc.net/api/v1/categories/list?pid={pid}&access_token={access_token}

Params
pid: required
access_token: required

Example
curl -X GET "https://api.vodgc.net/api/v1/categories/list?pid={pid}&access_token={access_token}"

 


 

Retrieve Content by Category ID

Returns total content feeds and feeds by category id and page. To seek deleted items add param: pubs_id={pid} and in the categoryId (cid) put 0

Type Request: GET

URL: https://api.vodgc.net/api/v1/category?cid={cid}&access_token={access_token}&page={page}

Params
cid: required
page: required
access_token: required

Example
curl -X GET "https://api.vodgc.net/api/v1/category?cid={cid}&access_token={access_token}&page={page}"

 


 

Create Category

This method will create a new category, if parent is empty will be the first category else the new category will be a child of his parent.

Type Request: PUT

URL: https://api.vodgc.net/api/v1/category?name={name}&pid={pid}&parent={parent}&access_token={access_token}

Params
name: required
pid: required
parent: not required
access_token: required

Example
curl -X PUT "https://api.vodgc.net/api/v1/category?name={name}&pid={pid}&parent={parent}&access_token={access_token}"

 


Content

 

Search in Content

This method search if query is string in fields: name,description,tags, else if query is numeric search in content_id.

Type Request: GET

URL: https://api.vodgc.net/api/v1/content/search?publishers_ids={1,2}&query={string}&access_token={access_token}

 

Params
access_token
: required
publishers_ids: required
query: required

Example
curl -X "https://api.vodgc.net/api/v1/content/search?publishers_ids={1,2}&query={string}&access_token={access_token}"

 


 

Change Highlight Content Thumbnail

Change the image of the content_id relevant, you must post the image file to upload it

Type Request: POST

URL: https://api.vodgc.net/api/v1/content/image

Params

content_id: required
access_token: required

Example
curl -X POST -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -F "file=@/path/to/image/filename" "https://api.vodgc.net/api/v1/content/image?access_token={access_token}&content_id={content_id}"

 


 

Update Content Info

Edit content info by passing relevant parameters

Type Request: POST

URL: https://api.vodgc.net/api/v1/content/editApi

Params

access_token: required (String)
content_id: required (int)
description: optional (String)
name: optional (String)
categories: optional (int,int)
status: optional ('enabled','disabled')
tags: optional (String)
comscore: optional (Array) 

Example form data

comscore[0][key] = 'ns_st_st'; 
comscore[0][value] = 'test';

Example
curl -X POST "https://api.vodgc.net/api/v1/content/editApi?access_token={access_token}&gid={gid}&content_id={content_id}&variables to change..."

 


 

Update Content Info (JSON)

Edit content info by passing relevant parameters

Type Request: PUT

URL: https://api.vodgc.net/api/v1/content/{id}

Params
access_token: required (String)
description: optional (String)
name: optional (String)
categories: optional (String) Example: "12,5,6" (category IDs)
status: optional ('enabled','disabled')
tags: optional (String) Example: "tag1,tag2,tag3"
comscore: optional (object) Example: { "ns_st_st" : "test"};

Example
curl -X PUT 'http://localhost:8000/api/v1/content/19' -H 'content-type: application/json' -d '{
    "access_token" : "access-token-value",
     "description" : "TEST API",
            "name" : "TEST API",
      "categories" : "9", 
          "status" : "enabled",
            "tags" : "test, test2",
        "comscore" : {
            "ns_st_st" : "TEST API" 
        } 
    }'

 


 

Retrieve Last Content By Pid

Return the last (indicated by limit) media content by pid/s (example pids: 1,2) if order param is set true brings the most played else brings the most recents

Type Request: GET

URL: https://api.vodgc.net/api/v1/content/list?pids={pids}&access_token={access_token}&limit={limit}

Params
pids: required
limit: required
access_token: required
order: not required

Example
curl -X "https://api.vodgc.net/api/v1/content/list?pids={pids}&access_token={access_token}&limit={limit}&order=false"

 


 

Content List By PID

Return plays, content_id, created_at with offset (from) and limit (maximum 5000) order by created_at

Type Request: GET

URL: https://api.vodgc.net/api/v1/statistics/content/publisherId/{pid}/from/{from_int}/limit/{limit_query_int}

Example
curl -X "https://api.vodgc.net/api/v1/statistics/content/publisherId/{pid}/from/{from_int}/limit/{limit_query_int}"

 


 

Retrieve Content By Content Id

Return media content info by content id.

Type Request: GET

URL: https://api.vodgc.net/api/v1/content/{content_id}

Params
content_id: required
access_token: required

Example
curl -X GET "https://api.vodgc.net/api/v1/content/{content_id}?access_token={access_token}"

 


 

Retrieve Content By Category

Return media content by categories id. (if order param is set true brings the most played else brings the most recents)

Type Request: GET

URL: https://api.vodgc.net/api/v1/content/?cids={cids}&access_token={access_token}&limit={limit}&order=false

Params
cids: required
limit: required
access_token: required
order: not required

Example
 curl -X GET "https://api.vodgc.net/api/v1/content/?cids={cids}&access_token={access_token}&limit={limit}&order=false"

Upload Video Content (Genoa Transcoder)

 Prefered method

Upload file/s into specific category, (external_id of your platform will be retrieve to your endpoint when process finished).

Format video: .mp4

Type Request: POST

URL for production: https://trx01.vodgc.net/upload

URL for testing: https://testtrx01.vodgc.net/upload

form-data params:
name: string*
pid: integer*
cid: integer*
created_by: string*
external_id: string
file: video file to upload*
access_token: ask to Genoa Administrator*
*Required params

Example
 <?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://trx01.vodgc.net/upload",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\ntest-1 elle publisher 45\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"pid\"\r\n\r\n45\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"cid\"\r\n\r\n280\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"created_by\"\r\n\r\nJony\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"access_token\"\r\n\r\n<access_token>\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--",
  CURLOPT_HTTPHEADER => array(
    "Postman-Token: 60936538-ec76-4bfe-b725-98b834bda2e8",
    "cache-control: no-cache",
    "content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

 


 

Upload Video Content (Cloud Transcoder)

Please use the  prefered method (Genoa Transcoder)

Upload file/s into specific category, (external_id of your platform will be retrieve to your endpoint when process finished), if test environment testuploads.vodgc.net

Format video: .mp4

Type Request: POST

URL: https://uploads.vodgc.net/api/v1/content/upload/0/{cid}?access_token={access_token}

Params
cid: required
access_token: required
file: required
external_id: optional

Example
<?php 
	 // Get Mime type 
	 $finfo = finfo_open(FILEINFO_MIME_TYPE); 
	 $mime_type = finfo_file($finfo, $path_absolute); 
	 finfo_close($finfo); 

	 // You can change video/mp4 for mimetype of your current file
	 //All files will be converted to MP4 after process ends.
	 $data = array('file' => new CurlFile($path_absolute, $mime_type), 'external_id' => $my_id);
	 $url = $this->api_url . 'content/upload/0/' . $cid . '?access_token=' . $this->get_access_token();
	 $curl = curl_init();
	 curl_setopt($curl, CURLOPT_URL, $url);
	 curl_setopt($curl, CURLOPT_POST, 1);
	 curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
	 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
	 curl_exec($curl);
	 $err = curl_error($curl);
	 curl_close($curl);
	 if ($err) {
		return false;
	 } else {
		return true;
	 }
?>

 


 

Upload Audio Content

Upload audio into specific category, if test environment testuploads.vodgc.net

Type Request: POST

URL: https://uploads.vodgc.net/api/v1/content/upload/audio

Params
access_token: required
name: required
description: not required
cid: required
tags: not required
file: required 

Example
curl -X POST -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -F "file=@FileName.mp3" "https://api.vodgc.net/api/v1/content/upload/audio?name={content name}&description={description}&cid={cid}&access_token={access_token}&tags=test,prueba"

 


 

Retrieve Historial by content ID

Retrieve historial of content item limit 10

Type Request: GET

URL: https://api.vodgc.net/api/v1/history/contentId/{content_id}

Params
access_token: required
page: required

Example
curl -X "https://api.vodgc.net/<g class="gr_ gr_235 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="235" data-gr-id="235">api</g>/v1/history/contentId?access_token={access_token}"

Retrieve qualities information by content ID

 

Retrieve main manifest, m3u8 per quality, thumb, mp4

Type Request: GET
URL: https://api.vodgc.net/api/v1/content/qualities

Params
access_token: required
content_id: required

Example
curl -X "https://api.vodgc.net/api/v1/content/qualities"

 


Change Youtube ID

Update youtube content in genoa by changing youtube ID

Type Request: PUT
URL: https://api.vodgc.net/api/v1/youtube

Params
access_token: required
content_id: required

yt_id: required ( Youtube ID example: b0sKJpCR9Fo )

 


 

Statistics

Retrieve Plays by date range group by content_id

This method returns content_id and plays

Type Request: GET

URL: https://api.vodgc.net/api/v1/statistics/content/plays/groupby/content?start=2017-10-01&end=2017-10-12&pid={pid}

Params:
start: required
end: required
pid: required 

Example
curl -X "https://api.vodgc.net/api/v1/statistics/content/plays/groupby/content?start=2017-10-01&end=2017-10-12&pid={pid}"

Retrieve Plays by date range group by days

This method returns date and plays by day

Type Request: GET

URL: https://api.vodgc.net/api/v1/statistics/content/plays/groupby/dates?start=2017-01-01&end=2017-11-14&pid={pid}&from={from}&limit={limit}

Params
start: required
end: required
pid: required
from: required
limit: required

Example
curl -X "https://api.vodgc.net/api/v1/statistics/content/plays/groupby/dates?start=2017-01-01&end=2017-11-14&pid={pid}&from={from}&limit={limit}"

 


Transcoder

Vantage XML Consolidation

This is an example and those are the settings required to insert content inside Genoa with vantage.

Values
referenceId: Vantage retrieve this unique ID, required
name: Name for the new content, required
description: Description for the new content, not required
categoryId: Category ID (Genoa), where the content will be located, not required
tags: Tags for the content separated by comma, not required
publisherId: Publisher's ID, required
createdBy: How Upload to Genoa this content, required
externalId: Your Platform Content ID
transcoder: Transcoder name

Example 
<mrss>
<channel>
<item>
<referenceId>0B3D7C688ECAD925D0A4F2175F17A316</referenceId>
<name>John Mayer Live in London</name>
<description>Great concert in london check it out!</description>
<categoryId>12</categoryId>
<tags>Music,Musician,Guitarrist,Concert,live</tags>
<publisherId>1</publisherId>
<createdBy>John Mayer</createdBy>
<externalId>1223</externalId>
<transcoder>Vantage Test</transcoder>
</item>
</channel>
</mrss>

UNE (Upload Notification Endpoint)

The UNE send a notification to your platform when content is already uploaded in genoa, Genoa post to your UNE content_id,thumb,external_id. UNE Can be added from GENOA->Publishers->UNE (Your Endpoint also needs to accept a variable test = 1 via post and return 200 for the connection test)

Values
content_id: Genoa Content ID
thumb: Genoa Thumb Source Url
external_id: Your content external id passed by vantage XML

Example

 


 

Player

 

How to add a custom parameter to VAST tag

If you want to add a custom parameters to VAST you have to add the pvast parameter to your emebed url and its value has to be an encoded url.

Example
<iframe src="http://api.vodgc.net/player/embed/playerId/111111111111/contentId/1?pvast=encodedurlparameters" frameborder="0" allowfullscreen width="650" height="390" scrolling="no"></iframe>

 


 

VAST Suffix for player settings

 

How to append a string to VAST tag

If you want to append a custom parameters to VAST to the player vast configuration you have to add the vast_suffix parameter to your emebed URL and its value has to be an encoded URL.

Example
<iframe src="http://api.vodgc.net/player/embed/playerId/111111111111/contentId/1?vast_suffix=encodedurlparameters" frameborder="0" allowfullscreen width="650" height="390" scrolling="no"></iframe>

 


  

Custom poster using an external image URL

 

How to use a custom poster using an external image URL

If you want to use a custom image URL you have to add the custom_poster parameter to your emebed URL and its value has to be an encoded URL.

Example
<iframe src="http://api.vodgc.net/player/embed/playerId/111111111111/contentId/1?custom_poster=encodedurlparameters" frameborder="0" allowfullscreen width="650" height="390" scrolling="no"></iframe> 

 


 

Autoplay

This parameter force autoplay even if your player is not configured with the autoplay behaviour.

Example
<iframe src="http://api.vodgc.net/player/embed/playerId/111111111111/contentId/1?autoplay=true" frameborder="0" allowfullscreen width="650" height="390" scrolling="no"></iframe>

 


 

Parameter blockvast

This parameter block ads in the specified content.

Example
<iframe src="http://api.vodgc.net/player/embed/playerId/111111111111/contentId/1?blockvast=true" frameborder="0" allowfullscreen width="650" height="390" scrolling="no"></iframe>

 


 

How to detect videos events

This way to detect videos will be deprecated soon.
The new way is documented here: https://doc.vodgc.net/books/api/page/tracking-events

To detect when video ends you need to add the script in the example before the iframe tag

<script type="text/javascript">
		/*
		    Copy this script if you want to execute your function when the video ends.
			Events:
				//**** video ****//
				video_play
				video_pause
				video_ended

				//**** audio ****//
				audio_play
				audio_pause
				audio_ended
				audio_download
                percent_played
				
				
			pass_data contiene por ejemplo: 
			{
				content_id: 54, 
				action: "video_end"
		 	}

		*/		
		function isJson(str) {
		    try {
		        JSON.parse(str);
		    } catch (e) {
		        return false;
		    }
		    return true;
		}
		window.onmessage = function(e){
			if(isJson(e.data)){
				var pass_data = JSON.parse(e.data);
			    if (pass_data.action == "video_ended") {
			    	//Here you can call your function
			        //console.log(pass_data);
			    }
			}
		};
	</script>

	//Here comes the iframe
    	<iframe src="your video source" frameborder="0" allowfullscreen width="650" height="390" scrolling="no"></iframe>

 


 

External Playlist

 

How to use an external playlist

If you want to use an external playlist you have to add the external_playslist parameter to your emebed URL and its value has to be content ids separted by commas.

 From player configuration at "Relation" tab you can configurate an autoplay behaviour checking the "Autoplay Relation" checkbox and also you can specify the delay.

Example
<iframe src="http://api.vodgc.net/player/embed/playerId/111111111111/contentId/1?external_playlist=1001,1002,1003,1004" frameborder="0" allowfullscreen width="650" height="390" scrolling="no"></iframe> 

 

 

Get Video Aspect 

Retrieve resolution by contents id

This method returns resolutions and aspects by the specificated contents only valid for video type.

 Aspect options returned ( 'widescreen' / 'vertical' )

Example
https://api.vodgc.net/api/v1/video/aspect?contents=169,162

Response Example:
{
    "162": "widescreen",
    "169": "vertical"
}

{
  content_id: aspect,
  content_id: aspect
}

 

 

 


 

How to Generate an Access Token

Ask to the Genoa admin about this process

 

 

 

No Comments

Back to top