Localization
/v1/localization/countriesList supported countries
curl -X GET https://api.tbbnetwork.com/v1/localization/countries \
-H "Authorization: Bearer sk_sandbox_..." \Response (200)
[
{
"code": "code",
"name": "Acme Co.",
"callingCode": "callingCode"
}
]/v1/localization/languagesList supported languages
curl -X GET https://api.tbbnetwork.com/v1/localization/languages \
-H "Authorization: Bearer sk_sandbox_..." \Response (200)
[
{
"code": "code",
"name": "Acme Co."
}
]/v1/localization/locateWhere the caller's connection seems to be: country, and region and city when known. For filling a place in the background; ask the person when city is null. A signed-in member can pass their device's coordinates to get the city there instead.
curl -X GET https://api.tbbnetwork.com/v1/localization/locate \
-H "Authorization: Bearer sk_sandbox_..." \Parameters
| lat | query | optional |
| lng | query | optional |
Response (200)
| Field | Type | Required |
|---|---|---|
| country | stringnull | — |
| region | stringnull | — |
| city | stringnull | — |
| latitude | numbernull | — |
| longitude | numbernull | — |
| source | coordinates | cdn | ip-city | ip-country | | — |
{
"country": null,
"region": null,
"city": null,
"latitude": null,
"longitude": null,
"source": "coordinates"
}Possible errors
Any other failure (validation, auth, rate limiting, a resource that doesn't exist) returns this same envelope with a non-2xx status — error.code is stable and safe to branch on; error.requestId is worth logging and including in a support request.
{
"error": {
"code": "VALIDATION_ERROR",
"message": "A human-readable description of what went wrong.",
"requestId": "req_01hxyz..."
}
}/v1/localization/normalize-phoneNormalize a phone number to a canonical format
curl -X POST https://api.tbbnetwork.com/v1/localization/normalize-phone \
-H "Authorization: Bearer sk_sandbox_..." \
-H "Idempotency-Key: 5f2f...b91" \
-H "Content-Type: application/json" \
-d '{
"phone": "+1-555-0173"
}'Request body
| Field | Type | Required |
|---|---|---|
| phone | string | yes |
Response (201)
| Field | Type | Required |
|---|---|---|
| normalized | string | — |
{
"normalized": "normalized"
}Possible errors
Any other failure (validation, auth, rate limiting, a resource that doesn't exist) returns this same envelope with a non-2xx status — error.code is stable and safe to branch on; error.requestId is worth logging and including in a support request.
{
"error": {
"code": "VALIDATION_ERROR",
"message": "A human-readable description of what went wrong.",
"requestId": "req_01hxyz..."
}
}