API: Using the Authorization Token
This document provides a guide for software developers to use the Archiver REST API.
The authorization token returned by the login method is a JWT token (JSON Web Token). It contains credentials that the Archiver application uses to grant access to certain resources. It is securely signed with a secret key using SHA256 to verify the sender of the token, and so that it cannot be modified or recreated by a third party. You can learn more about JWT here: https://jwt.io/introduction/.
The authorization token should be passed with all subsequent requests to the REST API, using the Authorization HTTP header. Different programming languages and libraries have different ways of specifying an HTTP header. Here is a bare bones example showing how it would be passed using the curl command. In this example, the authorization token is specified after "Authorization:":
curl -v -H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwibmFtZSI6IkFudGhvbnkgVmFsaWQgVXNl ciIsImlhdCI6MTQyNTQ3MzUzNX0.KA68l60mjiC8EXaC2odnjFwdIDxE__iDu5RwLdN1F2A" \
https://archiver.sageflo.com/etc...
The token is valid for 2 hours. It is recommended that you reuse the authorization token for a period of at least one hour, rather authenticate prior to every search, for example.