Uber Ride API - Driver - uber-api

We are busy looking at Uber Ride API and would like to find out the following:
Is all_trips scope applicable if OAuth authorized user is an Uber driver?
Will Webhook invoke events everytime when a driver accepts/cancels/completes a trips?
will Webhook be invoked during a real trip while the app is under development or Only work in Sandbox?

No. The all_trips scope only works for riders.
Yes. Every trip status change triggers a webhook. Possible statuses changes are:
processing
no_drivers_available
accepted
arriving
in_progress
driver_canceled
rider_canceled
completed.
(List pulled from here, according to the webhooks documentation here).
Yes. If you grant your app the all_trips scope, the Uber API will send webhooks to the URL you have registered at developer.uber.com/dashboard for every trip you take, i.e. sandbox and real trips alike. Note that there is currently no way to flag an Uber app as "in development" or "in production".

Related

PayPal Node SDKs: difference between paypal-rest-sdk and #paypal/checkout-server-sdk for webhooks?

I have this question regarding 2 npm PayPal packages, what is the difference between
paypal-rest-sdk and #paypal/checkout-server-sdk ? And can you implement webhooks using #paypal/checkout-server-sdk or there is no need for webhooks for this package ?
paypal-rest-sdk
checkout-server-sdk
var paypal = require('paypal-rest-sdk');
const paypal = require('#paypal/checkout-server-sdk');
All PayPal-*-SDK for every language have been deprecated for a long time and should not be used for anything. This includes the one for node that's in npm as #paypal/paypal-rest-sdk.
The Checkout-*-SDK for every language, in npm for node as #paypal/checkout-server-sdk, implements the v2/checkout/orders API (and only that API). It can still be used if desired, although I've heard it will be deprecated soon as well. Currently all developer.paypal.com documentation only references doing direct HTTPS REST API integrations, using a client id and secret to first obtain an access_token. For node in particular, there is a full stack example in the PayPal Checkout integration guide that serves as a useful starting point, although I recommend the client side onApprove function in this approval flow since that sample includes client-side error handling of the capture response (restarting or showing an error as appropriate)
As for webhooks, they are a separate matter. There is no current SDK for them. The server-side capture API response is already sufficient for normal orders API payments so you may not need webhooks for what you're doing, but if there are specific events you're interested in listening for (such as refunds or disputes that occur on PayPal.com ) you'll need to subscribe to the event(s) you want -- either in the REST app or using webhook API calls.

Uber API to detect rides

Is it possible to use the Uber API to detect rides that originated from the Uber app?
I'm trying to get a machine learning system to learn when you are using uber.
No, whether a ride originated from the Uber app or from a separate integration is not a field/endpoint in the current Uber API.
Not sure if this is exactly what you are looking for but something that might be helpful is the /history endpoint. "The User Activity endpoint returns a limited amount of data about a user’s lifetime activity with Uber. The response will include pickup and dropoff times, the city the trips took place in, the distance of past requests, and information about which products were requested."
Documentation: https://developer.uber.com/docs/riders/references/api/v1.2/history-get

Uber Deep link with promocode webhook

Case:
I bought Uber Event with promocodes.
Made a deep link from my app to Uber:
https://m.uber.com/ul/?client_id=xxxyyy-zzz&action=applyPromo&promo=existingtestpromo
Set up an API webhook in the Uber Dashboard to receive POST at https://45.55.254.130/uber/webhook/ (no domain yet and self-signed SSL)
User followed the link and made a ride. He finished the ride ok.
No webhook received at all(django+uwsgi logs empty on that url). I also tested that url manually sending POST request from code - it works.
Are the webhooks used at all when using deep links with promocodes?
Webhooks do not get sent when you use the deeplinks (promo code or set pickup). You can receive webhooks when you make a ride request using POST v1/requests or when you have the all_trips scope.
Here's information about making a ride request using the API: https://developer.uber.com/docs/rides/sdks/introduction
And here's information about all_trips scope (the feature is called Trip Experiences): https://developer.uber.com/docs/rides/tutorial-trip-experiences-getting-started

all_trips scope not returning current trip

I'm prototyping a trip experience. In debug we have a button that requests an in_progress ride to work with. Everything seems to work ok.
However, a release build (hitting the real API rather than sandbox) I get no trips back.
We have requested: request and all_trips scope.
We have the test users' uber accounts added to the developer portal.
Requesting the scopes is working, we're takin to the site and it asks for the appropriate scopes, the app is listed in the user's profile.
Any ideas? Is there a region limitation, for example?
Could you provide some more details on the the exact flow you are following and what endpoints you are hitting?
If you make a GET request to nonsandbox /v1/requests/current with an access token for a user that is on a trip, what response do you get back?

Uber API Request: All Vehicles Currently In Use

I'm making a ride request via the Uber API. I successfully make a request and get a response that it's in the Processing state. I then open my Uber app to watch until it goes into the Accepted state, but it never gets there. After about 15 seconds of processing, it pops up with a weird error message that I've never seen before in the Uber app: "All vehicles are currently in use. Please call (206) 622-6500". I called the phone number just to see, and it's the number for Yellow Cab in Seattle.
I try to make a request using the Uber app as normal, and it works fine.
I'm not making my ride request using the API sandbox; I'm actually trying to request a ride for myself using the limited access request scope for my personal account.
There's not any code to associate with this since I'm making a request successfully. Uber API support has requested that I ask a question on StackOverflow instead of reaching out to them directly.