Last active
February 7, 2017 14:13
-
-
Save tgaraptor/817ed02ec6774657d75d36aac954b09a to your computer and use it in GitHub Desktop.
php server request to the Raptor API
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 | |
$moduleName =$_GET['moduleName']; | |
$numberOfRecommendations =$_GET['numberOfRecommendations']; | |
$apiKey ="[Your API Key Here]"; //API key can be found in the controlpanel | |
$customerId = "[Your Customer Id Here]"; //customerid can be found in the controlpanel | |
$raptorUrl ="http://api.raptorsmartadvisor.com/v1/". $customerId ."/" . $moduleName ."/". $numberOfRecommendations ."/" . $apiKey; | |
$timeOutInSeconds= 1.5; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept:application/json',)); | |
curl_setopt($ch, CURLOPT_URL, $raptorUrl); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch,CURLOPT_TIMEOUT,$timeOutInSeconds); | |
$response = curl_exec($ch); | |
curl_close($ch); | |
echo $response; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment