API Token

Upon faraday v3.9 we included an API Token for our api. The token for the API will expire when the user changes the password.

You can configure token expiration in the [server] section of the configuration with the option api_token_expiration expressed in seconds.

Token expires by timeout or when the user changes the password. Each token is associated to the user who requests the token.

This is a example request of how to obtain a token

curl --user USER:PASSWORD http://localhost:5985/_api/v3/token/

Now that you got the auth token you can start using it on every request to the api:

curl 'http://localhost:5985/_api/v3/ws/' -H 'Authorization:Token AUTH_TOKEN' -H 'Content-Type: application/json' 
import requests
session = requests.Session()
user = 'faraday'
password = 'yourpassword'
session.auth = (user, password)
auth = session.post('https://localhost:5985/_api/v3/token')
response = session.get('https://localhost5985/_api/v3/token')
print(response.text) ## now the token is in response