Skip to content

Instantly share code, notes, and snippets.

@mimeoconnect
Created August 19, 2011 04:44
Show Gist options
  • Select an option

  • Save mimeoconnect/1156058 to your computer and use it in GitHub Desktop.

Select an option

Save mimeoconnect/1156058 to your computer and use it in GitHub Desktop.
Doc APIs - Card - Quote
<?php
$userid = "[user id]";
$userkey = "[user key]";
$pdfurl = "https://s3.amazonaws.com/kinlane-productions/pdf-samples/sample-card-425x55.pdf";
$size = "4.25x5.5";
$paper = "White Uncoated 60#";
$coating = "None";
$format = "json";
$environment = "Sandbox";
$URL = 'https://developer.mimeo.com/api/card/quote';
$QueryString = "?userid=" . $userid;
$QueryString .= "&userkey=" . $userkey;
$QueryString .= "&pdfurl=" . urlencode($pdfurl);
$QueryString .= "&size=" . urlencode($size);
$QueryString .= "&paper=" . urlencode($paper);
$QueryString .= "&coating=" . urlencode($coating);
$QueryString .= "&format=" . urlencode($format);
$QueryString .= "&environment=" . urlencode($environment);
$URL .= $QueryString;
//echo $URL . "<br />";
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, $URL);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle,CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($curl_handle,CURLOPT_CAINFO,'[path to crt]/ca-bundle.crt'); // Make sure and get a ca-bundle.crt and use to verify peer
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
var_dump($buffer);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment