Describe the calling key
const url = 'https://api.ebitex.io/audience/management/v1/whoami';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.ebitex.io/audience/management/v1/whoami \ --header 'Authorization: Bearer <token>'Reports what the Audience management key you are calling with is: the organization it belongs to, its own id and name, and its scopes.
It works with any valid, bound management key whatever its scopes, so a key that can only read can find out that reading is all it can do. Scopes are tiers: audience.management.write needs audience.management.read, and audience.management.erase needs both.
Key: any valid Audience management key, whatever its scopes.
Authorizations
Section titled “Authorizations”Responses
Section titled “ Responses ”{ "organizationId", "organizationName", "organizationSlug", "keyId", "keyName", "scopes": [ … ] }. scopes is sorted.
missing_api_key or invalid_api_key: no key was sent, or it is unknown, revoked or expired, or it was not created from the Audience settings page.
payment_required: the organization’s subscription needs attention.
scope_denied: the key lacks this route’s scope. ip_denied: the caller’s address is outside the key’s allowed ranges. app_not_available: Audience is not enabled for the organization.
not_found: no such route.
rate_limited: the key spent its requests-per-minute budget; Retry-After says how long to wait. too_many_failed_authentications: too many bad keys from this address.