Link Account
¶ Identity
The Identity endpoint links the requested third party account to the Uber user that has authorized the application.
¶ Resource
POST /v1/identity/link-account
¶ Authorization
OAuth 2.0 user access token that has the identity.link-account
scope
¶ POST Parameters
Parameter | Type | Description |
---|---|---|
thirdPartyUserID |
string |
The unique identifier of the user’s third party account. |
accountType (optional) |
enum |
Distinguishes the type of third party account being linked to the user’s Uber account. Must be configured prior to use, please contact 3p-identity-group@uber.com. |
¶ Example Request
Replace <TOKEN>
in the example below with a user access token
curl -X POST \
-H 'Authorization: Bearer <TOKEN>' \
-H 'Accept-Language: en_US' \
-H 'Content-Type: application/json' \
-d '{
"thirdPartyUserID": "{THIRD_PARTY_USER_ID}",
}' "https://api.uber.com/v1/identity/link-account"
¶ Response for Example Request
Status-Code: 200 OK
{}
¶ Subsequent response for Example Request
If subsequent requests are made with Example Request
it will also succeed. It will not return a conflict because the Uber user is already linked to the requested thirdPartyUserID
Status-Code: 200 OK
{}
¶ Unauthorized Request
Replace <BAD_TOKEN>
in the example below with a user access token that does not have the identity.link-account
scope
curl -X POST \
-H 'Authorization: Bearer <BAD_TOKEN>' \
-H 'Accept-Language: en_US' \
-H 'Content-Type: application/json' \
-d '{
"thirdPartyUserID": "{THIRD_PARTY_USER_ID}",
}' "https://api.uber.com/v1/identity/link-account"
¶ Unauthorized Response
Status-Code: 401 UNAUTHORIZED
{"code":"unauthorized","message":"This endpoint requires at least one of the following scopes: identity.link-account"}
¶ Conflict Request
Assume that Example Request
was sent, and you received a Success Response
. Now, you send a Conflict Request
:
- A new user access token (
<NEW_TOKEN>
) is provided with the samethirdPartyUserID
fromExample Request
. This will fail because thethirdPartyUserID
is already linked to the user inExample Request
. - The same user access token (
<TOKEN>
) is provided with a differentthirdPartyUserID
fromExample Request
. This will fail because the user is already linked to thethirdPartyUserID
fromExample Request
.
¶ Conflict Response
Status-Code: 409 CONFLICT
{"code":"conflict","message":"this user has already been linked to another account"}