Errors
Like all APIs, TradingPartners AI can occasionally encounter errors.
These can be linked to a user request, or to an internal problem.
We will try to describe the different alerts you may encounter and how to deal with them.
In most cases, an error will be accompanied by a description
field that will give you more information about the error.
Bad request - 400
Bad requests errors are usually caused by an invalid request send by the user.
Usually, some changes in the request can fix the problem.
The main 400 Bad Request
errors are :
Error code | Message | Hint |
---|---|---|
20 | invalid body | The body might be malformed |
21 | missing body field | The body is missing a required field |
22 | invalid body field | The body has an invalid field |
23 | missing path param | A mandatory path param is missing |
24 | invalid path param | A path param is invalid |
Unauthorized - 401
Unauthorised errors are usually caused by a session relative issue or invalid credentials.
Refresh your token, verify your Authorization
header and token type might fix the problem for Authorization
related
issues, or check your credentials depending on the request.
The main 401 Unauthorized
errors are :
Error code | Message | Hint |
---|---|---|
10 | missing authorization header | The Authorization header is missing |
11 | invalid authorization header | The Authorization header is invalid |
12 | session expired | The session has expired, try to login again |
13 | invalid email/password combination | The credentials are invalid |
Payment required - 402
Payment required error only appears when the user tries to reach an endpoint that requires a FULL API access
subscription.
Try to subscribe before your next try !
If the user has a FULL API access
subscription, and he has deactivated the automatic renewal mechanism, he might also receive this error.
Indeed, if he is currently connected to the alerts stream, once his last credit is consumed, the connection will automatically closed and the last message received will be the payment required
error.
Error code | Message | Hint |
---|---|---|
30 | Not enough credit | User has not enough credit to access the API |
Forbidden - 403
Forbidden errors are usually caused by a lack of permissions or a non activated account.
The main 403 Forbidden
errors are :
Error code | Message | Hint |
---|---|---|
32 | User not active | User has not activated his account. Check your emails to find the activation link. |
Not found - 404
Not found errors usually occur when the user tries to reach an endpoint that does not exist, or when the user tries to work on a non-existing resource.
The main 404 Not found
errors are :
Error code | Message | Hint |
---|---|---|
4 | Not found | The endpoint does not exist |
40 | User not found | The user does not exist |
41 | Token not found | The token does not exist or has expired |
Too many requests - 429
Too many requests error only appears when a FREE API access
user tries to request an endpoint that is limited
to FREE
users too soon.
If a FREE
user requests the closed alerts endpoint, get at least one alert, and do not wait 15m
before requesting again, he will receive the Too many requests
error.
Error code | Message | Hint |
---|---|---|
50 | Only one request per 15mn is allowed | The user has already requested the endpoint every 15 minutes. Try again in 15 minutes. |
Internal server error - 5XX
Internal server errors are usually caused by an internal issue.
User, usually can do nothing about it but to contact the technical support.
Error code | Message |
---|---|
99 | Internal error |