error ) ) { throw new Exception( $json->error_description ); } return $json->access_token; } function Request( $url, $authHeader ) { $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $url ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $authHeader, 'Content-Type: text/xml' ) ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, TRUE ); curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, FALSE ); $response = curl_exec( $ch ); if( curl_errno( $ch ) ) { throw new Exception( curl_error( $ch ) ); } curl_close( $ch ); return $response; } ?>