Fetch Design Source

Use this endpoint to fetch the source data for a design associated with your particular domain.

This requires a valid designId as well as the signature parameters to authenticate the call. You can check the fetch designs link to get all the designs in your domain.
Ensure you do not use the categoryId as against a designId. All designs are inside categories.

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

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-design-source');
curl_setopt($ch, CURLOPT_POST, true);

$opts = generateSignature();
$opts['designId'] = 'your-design-id-here';

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

$output = curl_exec($ch);
$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$content_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
$curlerr = curl_error($ch);
curl_close($ch);

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

echo $output;

?>
RESPONSE
{
    "_id": "5afb3c7960aa7ff504632367553a3fa2",
    "_folder": "761f4e66d4a1b8965df66061dc959175",
    "enabled": true,
    "lastModified": "2015-01-12T06:01:20.000Z",
    "_owner": "***",
    "map": {
        "backgroundimages": {
            "items": "",
            "mode": "exclude"
        },
        "colors": {
            "items": "",
            "mode": "exclude"
        },
        "images": {
            "items": "",
            "mode": "exclude"
        },
        "modules": "{}",
        "fonts": {
            "items": "",
            "mode": "exclude"
        }
    },
    "design": { /*design details here*/ }
}

Still need help? Contact Us Contact Us