Skip to content

Verify the API key

GET
/whoIAm
curl --request GET \
--url https://agent-dev.azizdubai.com/whoIAm \
--header 'X-API-Key: <X-API-Key>'

Returns the key that was presented, the company that owns it, the user who issued it and the price factor applied to its prices. Use it to confirm that a key is active and that its price vector is configured as intended.

The key, its company and its author.

Media typeapplication/json
object
status
required
string
Allowed value: success
data
required

The shape depends on the operation.

data
required
object
api_key
object
id
integer
name
string
key_prefix

The first characters of the key

string
status

0 — active

integer
Allowed values: 0 1
price_vector

Markup (positive) or discount (negative)

number format: double
price_factor

The same vector expressed as a multiplier — 1 + price_vector/100.

number format: double
created_at
string format: date-time
company
object
id
integer
company_type
integer
Allowed values: 2 3
name
string
logo
string | null
author

The user who issued the key, recorded as the author of everything done with it.

object
id
integer
name
string
email
string

Example

{
"status": "success",
"data": {
"api_key": {
"name": "CRM integration",
"status": 0
},
"company": {
"company_type": 2
}
}
}

The key is missing (missing api key) or invalid (invalid api key). The latter covers unknown, revoked and deleted keys. Every operation requires a key, so any request without one receives this response.

Media typeapplication/json
object
status
required
string
Allowed value: error
message
required

Human-readable message.

string

Examples

Exampleinvalid
{
"status": "error",
"message": "invalid api key"
}

The key is valid, but it is restricted to a list of domains and the request’s Origin (or Referer) does not match any of them; or the key’s agency has no approved licence.

Media typeapplication/json
object
status
required
string
Allowed value: error
message
required

Human-readable message.

string

Examples

{
"status": "error",
"message": "origin is not allowed for this api key"
}

An unexpected error. The cause is logged; a generic message is returned.

Media typeapplication/json
object
status
required
string
Allowed value: error
message
required

Human-readable message.

string

Examples

Examplegeneric
{
"status": "error",
"message": "internal server error"
}