Trying to test Uber Rush API (from localhost and from linux server).
Calling Token works - I get the token trying to implement sanbox example:
curl -X "PUT /v1/sandbox/deliveries/{delivery_id}" \
-H "Authorization: Bearer <OAUTH TOKEN>" \
-d "{\"status\":\"en_route_to_pickup\"}"
with url https://sandbox-api.uber.com/
and I tried the same request with file_get_contents (in PHP)
So, I always get error "405 Method Not Allowed"
{"message":"Method not supported for this endpoint.","code":"method_not_allowed"}
What I need to do to get access to method from this sandbox example https://developer.uber.com/docs/rush/sandbox?
Corrent syntax
curl -X "PUT" -H "Authorization: Bearer <TOKEN>" -H "Content-Type: application/json" -d "{\"status\":\"en_route_to_pickup\"}" https://sandbox-api.uber.com/v1/sandbox/deliveries/DELIVERY_ID
$url = 'https://sandbox-api.uber.com/v1/sandbox/deliveries/ID_HERE'; $headers = array( 'Authorization: Bearer '.TOKEN_HERE); $options = array( 'https' => array( 'header'=> $headers , ), ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context);- Евгений Иванов