I created a ride request and have a request_id that was returned in the response. Then I continuously poll the Uber API to get the current status every 3 seconds.
I need to know how many time I have to poll when the status is "processing" ?
Actualy, on the sandbox API, I poll 2 minutes and then if the status is still "processing" I stop the polling.
But when I try to create a new ride request I have this response :
HTTP/1.0 409 Conflict
Cache-Control: no-cache
Content-Type: application/json
{"meta":{},"errors":[{"status":409,"code":"current_trip_exists","title":"The user is currently on a trip."}]}
Do I have to delete the request after the 2 minutes ?
When you create your ride request on sandbox - it is created with the processing status - and it will stay in that state until you change the status of the trip. On sandbox you can do it by using PUT /sandbox/products/{product_id}
endpoint. In this document you can see how to change the state of the trip - modify sandbox request. After you modify it - when you poll the Uber API to get the current status - you will see the status change.
You can delete existing sandbox ride requests by issuing a DELETE HTTP call to the sandbox environment. When issued, the sandbox ride will transition into the rider_canceled status.
After that, you will be able to create the new trip with the same access_token.
Take a note that this is applicable only on sandbox. On the production environment, the trip status will change automatically. For the life cycle of the ride request please check this Uber documentation.