This API will work in Asynchronous manner . It will immediately return “Success” if items are ingested properly. It may take some time to sync with our MetaX system based on the quantum items in the feed to be ingested.
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 |
/** * Ingestion – Pull Metadata * **/ // Example Feed URL $feed_url = 'http://_FEED_URL_'; // Initialize pull data $ch = curl_init("http://__JTV__HOST__/metax/3.0/ingest/pull/?feed=" . rawurlencode($feed_url) ); curl_setopt_array($ch, array( CURLOPT_CUSTOMREQUEST => "GET", 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 4 |
{ result : "success", message: "Started processing" } |
1 2 3 4 5 |
{ result: "error", message: "UNAUTHORIZED", reason: "No Authorization Token" } |
1 2 3 4 5 |
{ result: "error", message: "INVALID", reason: "Missing mandatory parameters.” } |