Skip to main content
The Noyax API uses JWT access tokens. You get a token from the Noyax auth service with your API key and send it in the Authorization header of every request.

Flow

Getting a token

string
required
Your organization name, issued by Noyax.
string
required
Your API key.
If the credentials are wrong or your API license has expired, the auth service returns 401 (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.
Logging in again with the same 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:
Log in again, or get a new pair with the old access token and the refresh token:
The response has the same shape as the login response.
Every refresh issues a new refresh token and invalidates the previous one. If several servers or processes use the same key, logging in again instead of refreshing is the simplest option.
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 exp claim (Unix time). Log in again (or refresh) shortly before it expires or when you get a 401, then retry the request.
If the permissions or limits of your key change, the change takes effect when you get a new token.