Uber Rush API Sandbox -
trying test uber rush api (from localhost , linux server).
calling token works - token trying 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 tried same request file_get_contents (in php)
so, error "405 method not allowed"
{"message":"method not supported endpoint.","code":"method_not_allowed"}
what need access method 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
edit: updated reflect both issues in question...
you have mismatch in requests , incorrect syntax curl.
first off curl request incorrectly specified. should be:
curl -x "put" -h "authorization: bearer <oauth token>" -d "{\"status\":\"en_route_to_pickup\"}" https://sandbox-api.uber.com/v1/sandbox/deliveries/{delivery_id}
in addition, curl command trying issue put request uber sandbox put api. however, php code not setting context correctly , issuing request. suspect server therefore rejecting request not allowed sort of operation.
to fix it, see bad request using file_get_contents put request in php. should give example of how pass in necessary context issue put request using file_get_contents()
.
Comments
Post a Comment