Widgets Overview
¶ Introduction
The Widget SDK provides pre-made user interfaces that help speed up the integration with Uber APIs.
¶ Concepts
- Partner frontend: The application that will expose Uber features to an end user.
- Partner backend: A backend service for secure communication between the partner and Uber systems.
- Uber API: This is the collection of Uber REST endpoints that can be used directly or in conjunction with the Widget SDK.
¶ Authentication
Two authentication tokens are required.
¶ Business-to-business aka B2B (OAuth 2.0) token
This token is extensively documented in our authentication docs and it’s needed to call Uber APIs whether you decide to use the widget or not. It will be used to:
- Secure communications between the partner backend and Uber APIs.
- Obtain a Widget Transient token that will grant access to the widget.
¶ Widget Transient token
This is a new token. It will be used to:
- Instantiate the widget UI.
¶ Use case
Use this endpoint to create a widget transient token.
If the request is from a third party (3P) app, please add x-uber-organizationuuid header and the Organization UUID as the value or the request will be denied.
¶ Authorization
OAuth 2.0 Bearer token with the guests.trips
scope.
¶ Request
¶ Example request
Try It
curl -X POST \
-H "authorization: Bearer <access_token>" \
-H 'content-type: application/json' \
-d '{
"external_user_id": "<fill with external user uuid>"
}' \
'https://api.uber.com/u4b/v1/widget/transienttoken'
¶ Request headers
Header | Type | Description |
---|---|---|
x-uber-organizationuuid |
string | Organization UUID. |
¶ Request body parameters
Field | Type | Description |
---|---|---|
external_user_id |
string | External user ID, ranging from minimal 3 to 36 characters. |
¶ Response
¶ Example response
{
"token": "<validtoken>"
}
¶ Response body parameters
Field | Type | Description |
---|---|---|
token |
string | The widget transient token. |
¶ Endpoint Possible Errors
HTTP Status | Code | Description |
---|---|---|
400 | validation_failed | This error occurs when required fields are missing or invalid in the request payload. For example, if the external user ID is missing in the request payload. |
500 | internal_server_error | An unexpected error occurred on the server while processing the request. |