Authorization header of every request.
Flow
Getting a token
Invalid API credentials., ApiKey expired.).
The auth service response has
Data, Success and Message fields; the ResultCode and Errors fields of Noyax API responses are not present here.OrgName and ApiKey returns the same token unless it is about to expire, so logging in before every request is fine.
Refreshing a token
Access tokens are valid for 20 minutes. When a token expires, the API responds with:Recommended practice
Pick one of two approaches:- Log in before every request. The simplest option; login returns the unexpired token again.
- Keep the token and reuse it. The access token is a JWT; its expiry is in the
expclaim (Unix time). Log in again (or refresh) shortly before it expires or when you get a401, then retry the request.
If the permissions or limits of your key change, the change takes effect when you get a new token.