Error "token not authorised"

The error "token not authorised" might indicate that you're passing just the API key for tokenised authentication and not an encoded username+API key combination.

To successfully authenticate to the Zai API, there are two methods to use:

  1. Basic authentication using your username and API key.
  2. Tokenised authentication using a Base64 encoded username and API key to pass a single authentication token.
For more information on API keys and authenticating with Zai, refer to the guide on API Keys.