Fetch PDF

Use this endpoint to fetch the PDF File for a project associated with your particular domain.

This requires a valid projectId as well as the signature parameters to authenticate the call.

[POST] https://pitchprint.net/api/runtime/fetch-pdf
BODY PARAMS
apiKey Your domain's api key
timestamp Timestamp generated at runtime
signature Signature = MD5(apikey + secretKey + timestamp)
projectId ID of a project

SAMPLE CODE
<?php

define('PITCH_APIKEY', 'your-api-key');
define('PITCH_SECRETKEY', 'your-secret-key');

function generateSignature () {
    $timestamp = time();
    $signature = md5(PITCH_APIKEY . PITCH_SECRETKEY . $timestamp);
    return array ('timestamp'=>$timestamp, 'apiKey'=>PITCH_APIKEY, 'signature'=>$signature);
}

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://pitchprint.net/api/runtime/fetch-pdf');
curl_setopt($ch, CURLOPT_POST, true);

$opts = generateSignature();
$opts['projectId'] = 'your-project-id-here';

curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($opts));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$output = curl_exec($ch);
curl_close($ch);

header('Content-Type: application/pdf');

echo $output;

?>

Still need help? Contact Us Contact Us