The following API will delete a title/item from the system.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
/** * Ingestion – Delete Metadata * **/ // Example XML Data $xml_data = '<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"> <channel> <title>CHANNEL TITLE</title> <description>CHANNEL DESCRIPTION</description> <pubDate>2016-08-31 11:40:20.0</pubDate> <item> <guid>XYZ123456</guid> <title>MOVIE TITLE</title> <media:thumbnail type="small" url="SMALL THUMBNAIL URL" /> <media:thumbnail type="large" url="LARGE THUMBNAIL URL" /> <media:content bit_rate="low-quality" url="LOW QUALITY MEDIA URL" filesize="15903581" type="video/quicktime" /> <media:content bit_rate="high-quality" url="HIGH QUALITY MEDIA URL" filesize="14326806" type="video/quicktime" /> </item> </channel> </rss>'; // Initialize delete data $ch = curl_init("http://__JTV__HOST__/metax/3.0/ingest/XYZ123456"); // Here "XYZ123456" is "GUID" curl_setopt_array($ch, array( CURLOPT_CUSTOMREQUEST => "DELETE", CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_HTTPHEADER => array( "Authorization: Bearer " . $token // Get token from "Getting Access Tokens" ) )); //execute $result = curl_exec($ch); // Check for errors if (!curl_errno($ch)) { $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); }else{ die(curl_error($ch)); } //close connection curl_close($ch); if(isset($httpcode) && $httpcode == 200){ echo $result; }else{ echo "HTTP Status Code ". $httpcode; } |
1 2 3 |
{ "status" : "success" } |
1 2 3 4 5 |
{ result: "error", message: "UNAUTHORIZED", reason: "No Authorization Token" } |
1 2 3 4 5 |
{ result: "error", message: "INVALID", reason: "Asset GUID not found.” } |
1 2 3 4 5 |
{ result: "error", message: "INVALID", reason: "Something went wrong. Please try again later.” } |
1 2 3 4 5 |
{ result: "error", message: "INVALID", reason: "Invalid tag” } |
1 2 3 4 5 |
{ result: "error", message: "INVALID", reason: "Invalid URL format" } |