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.

Note

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 codeMessageHint
20invalid bodyThe body might be malformed
21missing body fieldThe body is missing a required field
22invalid body fieldThe body has an invalid field
23missing path paramA mandatory path param is missing
24invalid path paramA 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 codeMessageHint
10missing authorization headerThe Authorization header is missing
11invalid authorization headerThe Authorization header is invalid
12session expiredThe session has expired, try to login again
13invalid email/password combinationThe 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 !

Non automatic renewal

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 codeMessageHint
30Not enough creditUser 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 codeMessageHint
32User not activeUser 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 codeMessageHint
4Not foundThe endpoint does not exist
40User not foundThe user does not exist
41Token not foundThe 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.

Get closed won alerts every 15m

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 codeMessageHint
50Only one request per 15mn is allowedThe 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 codeMessage
99Internal error