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.
/content_metadata_by_filename
http://myserver/content_metadata_by_filename/Sample.m2p
filename
String
Sample.m2p
The filename can be determined by looking at the details page for any content.
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:
simplexml_load_file()
myserver
< ?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.
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.
id
< ?xml version="1.0" encoding="UTF-8"?> Content with filename: Sample.m2p does not exist.