Access tokens
Every request to the API carries an access token in its Authorization header. An access
token lasts five minutes. It is made from a refresh token: this page's login (Logging in), or
a script's offline token (Creating a token for a script).
While you are logged in
The page makes access tokens by itself, whenever a request or Copy with your token needs one and the one it has is about to end. Get an access token does the same on demand and shows the exchange, if one was needed: the page answers from the token it has while that has more than 30 seconds left.
Copy puts the token itself on the clipboard, for a tool of your own. It works until its end, shown beside it.
In a script
The client libraries do this for you. In the shell, the sample on the right does it: one
request with the refresh token saved in reconnectchina-token, whose answer holds the access
token. It puts that in $TOKEN, where the operation pages' curl commands read it, and when the
answer also holds a refresh_token, saves that in place of the one it sent.
The refresh token reaches curl on its standard input, not its command line, which other users of the machine can read.