Video Web Service

From Fliqz FAQ

Jump to: navigation, search


Contents

Introduction

The Video Web Service is established to query for data associated with individual Video Assets. It returns data for one Video Asset at a time based on a unique Video ID.

A typcial scenario in which the Video Web Service would be used would be one where a local database has been setup to track uploaded content for your site. You have captured the Video ID's associated with each Video in your database. Using these ID's you would then execute a Video Web Service call to gather details associated with the Video Asset from the Fliqz repository.

This might be done to refresh your local database, or to display selected details, for the video, somewhere in the context of your website.

Data available through the Video Web Service via the Get Video Info Operation includes:

  • Thumbnail
  • Title
  • Description
  • Duration
  • Embed Code
  • Permalink
  • Total number of Plays.
  • The current Video Rating
  • The current number of Shares
  • Size in bytes
  • The current Status
  • Uploaded Date
  • Video ID

In addition, the Video Web Service provides a variety of Operations that can be performed on a Video Asset to gather additional information or interact with the Video Asset in some way.

These Operations include:

  • Get Video Info (See above)
  • Get Title
  • Get Permalink
  • Get Embed Code
  • Get Rating
  • Flag
  • Get Flag Report
  • Get All Plays
  • Get All Shares


Service Details

  • XML Namespace: http://fliqz.com/services/080107
  • Location: http://services.fliqz.com/videoservice/080107/service.svc?wsdl


The Video Web Service provides access to management information concerning videos hosted by Fliqz.


Operations


Get Video Info

Returns information concerning a video with a given ID, associated with the account which uploaded the video.

Parameters

  • Video ID: A string containing the ID (GUID) of the video.
GUID Type: globally unique identifier
A 32-character hexadecimal string in the following form:
Regular Expression: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}
Sample: F9168C5E-CEB2-4FAA-B6BF-329BF39FA1E4

Response

The response is in the form of a Video Info type which has the following fields:-

  • Cooked Thumbnail: A thumb which has been adjusted according to default account’s requirements.
  • Description: A description of the video.
  • Duration: The duration of the video in seconds.
  • Embed: A full embed code constructed using the template associated with the default account.
  • Permalink: A permalink constructed using the template associated with the default account.
  • Plays: The total number of plays for the video.
  • Rating: The current rating of the video.
  • Raw Thumbnail: The thumbnail generated by default by Fliqz.
  • Shares: The current number of shares for the video.
  • Simple Embed: A simple embed code constructed using the template associated with the default account.
  • SizeInBytes: The size of the video in bytes.
  • Status: The current status of the video.This may take one of the following values:-
    • Available
    • Encoding
    • Broken
    • Deleted
  • Title: The title of the video.
  • Uploaded Date: The date and time when the video was uploaded.
  • Name: The index or ID forming the name of the video.

Sample

function GetVideoInfo($VideoID) {

// Setup your Soap Proxy (Syntax depends on how you implement SOAP)
$proxy = SetupSoapProxy('http://services.fliqz.com/videoservice/080107/service.svc?wsdl');
// Setup our request array
$request = array('VideoID' => $VideoID);
// Call the SOAP method
$result = $proxy->GetVideoInfo($request);
// Check Results (Method used to check for Errors will depend on how you implement SOAP)
if(CheckSoapResults($proxy) === NULL) {
//GetVideoInfoResult contains the array of data for the target video
return($result['GetVideoInfoResult']);
} else {
return(NULL);
}

}

Notes:

  • This sample will not work unless SetupSoapProxy() and CheckSoapResults() are fully implemented and operational
  • In the above example, a successful SOAP call will return an array ($result) containing information about the target video.
  • $result['GetVideoInfoResult'] contains the data associated with the target video.

Sample Result Array

array {

CookedThumbnail = "http://images.fliqz.com/22072f9a1e334f09a9e01c1ffcd92755.jpg"
Description = "Public Domain"
Duration = "PT6M17S"
Embed = "<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" id="player" height="342" width="512"><param name="movie" value="http://applications.fliqz.com/f828619a4706461c8656c4027167aa10.swf"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><param name="FlashVars" value="file=c34026ced8cec636ccb102acdc756bee&"><embed src="http://applications.fliqz.com/f828619a4706461c8656c4027167aa10.swf" name="player" allowfullscreen="true" allowscriptaccess="always" flashvars="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" height="342" width="512"></object>"
Name = "c34026ced8cec636ccb102acdc756bee"
Permalink = "http://www.fliqz.com/aspx/permalink.aspx?vid=2f574d27dc00444e864e9ca88b2c600e"
Plays = "32"
Rating = "5"
RawThumbnail = "http://images.fliqz.com/22072f9a1e334f09a9e01c1ffcd92755.jpg"
Shares = "7"
SimpleEmbed = "<embed src="http://applications.fliqz.com/f828619a4706461c8656c4027167aa10.swf" name="player" allowfullscreen="true" allowscriptaccess="always" flashvars="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" height="342" width="512">"
SizeInBytes = "29544110"
Status = "Available"
Title = "How Much?"
UploadedDate = "2008-08-26T22:58:55.907"

}

Notes:

  • The result array contains 2 pointers to thumbnails. For consistency in thumbnail display on your site, choose CookedThumbnail.
  • There are also 2 embed code versions returned. To ensure proper display of the player in all browsers, choose Embed.
  • The Duration is returned as [Duration]
  • Name = the video id of the video as a string



Get Rating

Returns the rating of the video with a given ID or index.

Parameters

  • Video ID: A string containing the ID (GUID) of the video.

Response

  • Current Rating: A string containing a number from 1-5 representing the average ranking based on the number of times the Video has been ranked vs the individual rankings.

Sample

function GetRating($VideoID) {

// Setup your Soap Proxy (Syntax depends on how you implement SOAP)
$proxy = SetupSoapProxy('http://services.fliqz.com/videoservice/080107/service.svc?wsdl');
// Setup our request array
$request = array('VideoID' => $VideoID);
// Call the SOAP method
$result = $proxy->GetRating($request);
// Check Results (Method used to check for Errors will depend on how you implement SOAP)
if(CheckSoapResults($proxy) === NULL) {
return($result['GetRatingResult']);
} else {
return(NULL);
}

}

Notes:

  • This sample will not work unless SetupSoapProxy() and CheckSoapResults() are fully implemented and operational




Get Permalink

Returns a URI containing the permalink for the video with a given ID or index using the permalink template associated with the account which uploaded the video.

Parameters

  • Video ID: A string containing the ID (GUID) of the video.

Response

  • A string containing a URL to a page hosting the video based on the permalink template associated with the account which uploaded the video.

Sample

function GetPermalink($VideoID) {

// Setup your Soap Proxy (Syntax depends on how you implement SOAP)
$proxy = SetupSoapProxy("http://services.fliqz.com/videoservice/080107/service.svc?wsdl");
// Setup our request array
$request = array('VideoID' => $VideoID);
// Call the SOAP method
$result = $proxy->GetPermalink($request);
// Check Results (Method used to check for Errors will depend on how you implement SOAP)
if(CheckSoapResults($proxy) === NULL) {
return($result['GetPermalinkResult']);
} else {
return(NULL);
}

}

Notes:

  • This sample will not work unless SetupSoapProxy() and CheckSoapResults() are fully implemented and operational




Get Embed

Returns the embed for the video with a given ID or index using the embed template associated with the account which uploaded the video.

Parameters

  • Video ID: A string containing the ID (GUID) of the video.

Response

  • Returns a String containing the Embed Code which can be used to embed a player on a web page, which will play the target video.

Sample

function GetEmbed($VideoID) {

// Setup your Soap Proxy (Syntax depends on how you implement SOAP)
$proxy = SetupSoapProxy('http://services.fliqz.com/videoservice/080107/service.svc?wsdl');
// Setup our request array
$request = array('VideoID' => $VideoID);
// Call the SOAP method
$result = $proxy->GetEmbed($request);
// Check Results (Method used to check for Errors will depend on how you implement SOAP)
if(CheckSoapResults($proxy) === NULL) {
return($result['GetEmbedResult']);
} else {
return(NULL);
}

}

Notes:

  • This sample will not work unless SetupSoapProxy() and CheckSoapResults() are fully implemented and operational




Get Flag Report

Flags the video with a given ID or index using an array of flags accompanied by an (optional) description.Only one flag of any type is counted in flagging operations.

Parameters

  • Video ID: A string containing the ID (GUID) of the video.

Response

The response is in the form of an Array containing a Flag Report which has the following fields:-

  • Pornography: Contains the count of the number of times that the video has been flagged with the PORNOGRAPHY flag.
  • Violence: Contains the count of the number of times that the video has been flagged with the VIOLENCE flag.
  • Racial: Contains the count of the number of times that the video has been flagged with the RACIAL flag.
  • Language: Contains the count of the number of times that the video has been flagged with the FOUL_LANGUAGE flag.
  • Other: Contains the count of the number of times that the video has been flagged with the OTHER flag.

Sample

function GetFlagReport($VideoID) {

// Setup your Soap Proxy (Syntax depends on how you implement SOAP)
$proxy = SetupSoapProxy("http://services.fliqz.com/videoservice/080107/service.svc?wsdl");
// Setup our request array
$request = array('VideoID' => $VideoID);
// Call the SOAP method
$result = $proxy->GetFlagReport($request);
// Check Results (Method used to check for Errors will depend on how you implement SOAP)
if(CheckSoapResults($proxy) === NULL) {
return($result['GetFlagReportResult']);
} else {
return(NULL);
}

}

Notes:

  • This sample will not work unless SetupSoapProxy() and CheckSoapResults() are fully implemented and operational

Sample Result Array

array {

language = "0"
other = "0"
pornography = "0"
racial = "0"
violence = "0"

}





Get All Shares

Returns the total number of shares for video with a given Video ID.

Parameters

  • Video ID: A string containing the ID (GUID) of the video.

Response

  • Returns a string containing the total number of shares for video with a given video ID.

Sample

function GetAllShares($VideoID) {

// Setup your Soap Proxy (Syntax depends on how you implement SOAP)
$proxy = SetupSoapProxy("http://services.fliqz.com/videoservice/080107/service.svc?wsdl");
// Setup our request array
$request = array('VideoID' => $VideoID);
// Call the SOAP method
$result = $proxy->GetAllShares($request);
// Check Results (Method used to check for Errors will depend on how you implement SOAP)
if(CheckSoapResults($proxy) === NULL) {
return($result['GetAllSharesResult']);
} else {
return(NULL);
}

}

Notes:

  • This sample will not work unless SetupSoapProxy() and CheckSoapResults() are fully implemented and operational




Get Duration

Returns the duration in seconds of the video with a given Video ID.

Parameters

  • Video ID: A string containing the ID (GUID) of the video.

Response

  • Returns a string containing the Duration in seconds of the video with the target Video ID.

Sample

function GetDuration($VideoID) {

// Setup your Soap Proxy (Syntax depends on how you implement SOAP)
$proxy = SetupSoapProxy("http://services.fliqz.com/videoservice/080107/service.svc?wsdl");
// Setup our request array
$request = array('VideoID' => $VideoID);
// Call the SOAP method
$result = $proxy->GetDuration($request);
// Check Results (Method used to check for Errors will depend on how you implement SOAP)
if(CheckSoapResults($proxy) === NULL) {
return($result['GetDurationResult']);
} else {
return(NULL);
}

}

Notes:

  • This sample will not work unless SetupSoapProxy() and CheckSoapResults() are fully implemented and operational


Get All Plays

Returns the total number of plays for video with a given Video ID.

Parameters

  • Video ID: A string containing the ID (GUID) of the video.

Response

  • Returns a String containing the total number of plays for video with the target Video ID.

Sample

function GetAllPlays($VideoID) {

// Setup your Soap Proxy (Syntax depends on how you implement SOAP)
$proxy = SetupSoapProxy("http://services.fliqz.com/videoservice/080107/service.svc?wsdl");
// Setup our request array
$request = array('VideoID' => $VideoID);
// Call the SOAP method
$result = $proxy->GetAllPlays($request);
// Check Results (Method used to check for Errors will depend on how you implement SOAP)
if(CheckSoapResults($proxy) === NULL) {
return($result['GetAllPlaysResult']);
} else {
return(NULL);
}

}

Notes:

  • This sample will not work unless SetupSoapProxy() and CheckSoapResults() are fully implemented and operational


Error Handling

All operations may return an error containing a GUID identifying an error which is logged by Fliqz.The purpose of this mechanism is to obfuscate the error whilst retaining the ability to diagnose the error.

Operations requiring the ID or index of a video or an account ID may return a ValidationFault if a required parameter is empty or not specified.

Personal tools