How to use the access token from uber api in accessing trip history How to use the access token from uber api in accessing trip history curl curl

How to use the access token from uber api in accessing trip history


Try to using curl to php converter from here https://incarnate.github.io/curl-to-php/

here is the result

$ch = curl_init();curl_setopt($ch, CURLOPT_URL, "https://api.uber.com/v1.2/history");curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");$headers = array();$headers[] = "Authorization: Bearer ".$token;$headers[] = "Accept-Language: en_US";$headers[] = "Content-Type: application/json";curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); //For httpscurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);//For https$result = curl_exec($ch);if (curl_errno($ch)) {    echo 'Error:' . curl_error($ch);}curl_close ($ch);print_r($result);