Account API is available at https://ean-db.com/api/v2/account
endpoint.
A request like this:
curl -X GET -H 'Authorization: Bearer HERE_GOES_YOUR_JWT_TOKEN' -H 'Accept: application/json' \
https://ean-db.com/api/v2/account
returns a response with 200
response code and an AccountResponse object.
You can use either Accept: application/json
to get a JSON response (this is also the default value if Accept
header is ommited) or Accept: application/xml
to get a response in XML format.
{
"account": {
"primaryEmail": "your@email.com", // Your email
"balance": 49973 // Your current balance (remaining requests), integer
}
}
You can get 403 response for a couple of reasons:
Authorization
header containing your JWT is missing, malformed or invalid.
In this case you’ll see a message JWT is missing or invalid, check Authorization header
in the description
field of the error response. You could check the tutorial for more information on how get JWT and pass it correctly.
Your JWT was revoked (look for JWT revoked
message in the description
field).
You can revoke your current JWT (and effectively deny access to anyone who tries to use it) in your account area. This error is what you’ll see if you make an API request using one of the revoked JWTs.
Your JWT is expired (look for JWT expired
message in the description
field).
JWT expires after one year since it was generated. If you get this error, you need to generate new JWT in your account area and replace the old one with freshly generated JWT.
{
"error": {
"code": 403,
"description": "JWT is missing or invalid, check Authorization header" // Or one of the other error messages
}
}