Category : api

I am working with an API that allows to request a pdf file which is returned like below. I have tried converting the file to base64 then rendering it as an object echo ‘<embed width="100%" height="100%" src="data:application/pdf;base64,’ . base64_encode($getsbAlljobmedia); API CALL ——– GET /api/v1/Media/{mediaID}/File DATA RETURN ———– %PDF-1.2 %���� 4 0 obj << /E 12282 ..

Read more

<?php error_reporting(E_ALL); echo "faseeh"; $paymentref = $_GET["ref"]; echo $paymentref; // api key $apikey = ""; $ch = curl_init(); // curl_setopt($ch, CURLOPT_URL, "https://api-gateway.sandbox.ngenius-payments.com/identity/auth/access-token"); curl_setopt($ch, CURLOPT_URL, "https://api-gateway.ngenius-payments.com/identity/auth/access-token"); curl_setopt($ch, CURLOPT_HTTPHEADER, array( // "accept: application/vnd.ni-identity.v1+json", "authorization: Basic ".$apikey, "content-type: application/vnd.ni-identity.v1+json" )); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, 1); // curl_setopt($ch, CURLOPT_POSTFIELDS, "{"realmName":"ni"}"); $output = json_decode(curl_exec($ch)); // echo "<pre>"; // print_r($output); ..

Read more