Overview
The REST Web Service, located at /content_metadata_by_filename
, can return the Content ID and other metadata for a file. The REST service results are limited to 1K in size. You can use the Content ID to delete the content via SOAP, for example.
Request URL
http://myserver/content_metadata_by_filename/Sample.m2p
Parameters
Parameter | Type | Required | Max Length | Description |
---|---|---|---|---|
filename |
String |
![]() |
128 | The filename of the content file on the server. In the above example URL, Sample.m2p is the filename. |
The filename can be determined by looking at the details page for any content.
Code Examples
PHP
This example uses PHP 5’s handy simplexml_load_file()
function. This function converts the XML return into an ordinary PHP object. Change myserver
and Sample.m2p
accordingly:
< ?php $xml = simplexml_load_file( 'http://myserver/content_metadata_by_filename/Sample.m2p' ); // print_r($xml); // Shows all properties of the object. Good for debugging. // Access the XML elements like you normally access Properties of a PHP object: echo($xml->name);
echo($xml->description);
echo($xml->{'actual-duration'}); // Enclose dashed Properties in {''}.
echo($xml->{'created-at'});
echo($xml->duration);
// ...and so on...
?>
We recommend that you wrap the simplexml_load_file()
call above in some additional error handling to gracefully trap cases when connectivity to the server is offline.
Return
Success
A typical return is in this example:
< ?xml version="1.0" encoding="UTF-8" ?>
30130
2009-07-29T13:09:47-04:00
2009-12-31T18:00:00-05:00
Sample Content for TelVue
31
Premiere
Sample.m2p
152
2009-07-29T13:09:47-04:00
Sample
Sample Content
1
Community
true
The program’s Content ID can be found in the “id
” field in the response.
Failure
File not Found
< ?xml version="1.0" encoding="UTF-8"?>
Content with filename: Sample.m2p does not exist.