Created
July 1, 2013 02:56
-
-
Save infusedmj/5898086 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// START OAP API | |
$data = "<purchase_history> | |
<contact_id>246029</contact_id> | |
</purchase_history>"; | |
$data = urlencode(urlencode($data)); | |
// Replace the strings with your API credentials located in Admin > OfficeAutoPilot API Instructions and Key Manager | |
$appid = "our-app-id"; | |
$key = "our-app-key"; | |
$reqType = "purchase_history"; | |
$postargs = "appid=".$appid."&key=".$key."&reqType=".$reqType."&data=".$data; | |
$request = "https://api.moon-ray.com/pdata.php"; | |
$session = curl_init($request); | |
curl_setopt ($session, CURLOPT_POST, true); | |
curl_setopt ($session, CURLOPT_POSTFIELDS, $postargs); | |
curl_setopt ($session, CURLOPT_HEADER, false); | |
curl_setopt ($session, CURLOPT_RETURNTRANSFER, true); | |
$response = curl_exec($session); | |
curl_close($session); | |
header("Content-Type: text/xml"); | |
echo $response; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment