Last active
January 29, 2018 18:21
-
-
Save reginaldojunior/4fa54e471ba1829093fbacbd346f637c to your computer and use it in GitHub Desktop.
Get Orders PluggTo PHP Example
This file contains hidden or 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 | |
$curl = curl_init(); | |
$accessToken = 'seuacessotokenaqui'; | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => "http://api.plugg.to/orders?access_token={$accessToken}&limit=100&modified=2018-01-25to2018-01-26", | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => "", | |
CURLOPT_MAXREDIRS => 10, | |
CURLOPT_TIMEOUT => 30, | |
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, | |
CURLOPT_CUSTOMREQUEST => "GET", | |
CURLOPT_HTTPHEADER => array( | |
"content-type: application/json", | |
), | |
)); | |
$response = curl_exec($curl); | |
$err = curl_error($curl); | |
curl_close($curl); | |
if ($err) { | |
echo "cURL Error #:" . $err; | |
} else { | |
echo $response; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment