Foreign IDs
Abound enables developers to associate a user
records with a unique, customer-specific ID, known as a foreignId
.
This allows developers lookup and retrieve a user
record ( and subsequently resources connected to that userId
) with the ease of using their own in-house indentifiers and the promise of uniqnuess.
Uniqueness
Foreign IDs must be unique. If a foreign ID is not unique, a 409 Error will occur.
Below is an example error response when a uniqueness conflict occurs:
{
"message": "Expected foreignId to be unique"
}
Examples
Here are a few example of working with foreign IDs.
Adding a foreignId to a user record
curl \
--request POST \
--url https://sandbox-api.withabound.com/<<apiVersion_v4>>/users \
--header 'Authorization: Bearer <<apiKey>>' \
--header 'Content-Type: application/json' \
--data '{
"email": "[email protected]",
"foreignId": "your_foreign_id"
}'
{
"id": "userId_sampleXGMFnhOpeR",
"createdAt": "2023-10-09T21:14:01.109Z",
"email": "[email protected]",
foreignId": "your_foreign_id"
}
Retrieving a user record by foreignId
curl \
--request GET \
--url https://sandbox-api.withabound.com/<<apiVersion_v4>>/users?foreignId=your_foreign_id \
--header 'Authorization: Bearer <<apiKey>>' \
--header 'Content-Type: application/json'
[
{
"id": "userId_sampleXGMFnhOpeR",
"createdAt": "2023-10-09T21:14:01.109Z",
"email": "[email protected]",
"foreignId": "your_foreign_id"
}
]
Updated 5 months ago