import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
uber_direct: {
type: "app",
app: "uber_direct",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.uber.com/v1/customers/${this.uber_direct.$auth.customer_id}/deliveries`,
headers: {
Authorization: `Bearer ${this.uber_direct.$auth.oauth_access_token}`,
"Content-Type": `application/json`,
},
})
},
})
Uber Direct uses OAuth authentication. When you connect your Uber Direct account, Pipedream will open a popup window where you can sign into Uber Direct and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Uber Direct API.
Pipedream requests the following authorization scopes when you connect your account:
POST
https://auth.uber.com/oauth/v2/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{custom_fields.client_id}}
&
client_secret={{custom_fields.client_secret}}
&
grant_type=client_credentials
&
scope=direct.organizations eats.deliveries