Function opentdb::session_new
source · pub fn session_new() -> Result<ApiSessionNew, Error>
Expand description
Retrieve a new API token
The Open Trivia Database provides a completely free JSON API for use in programming projects. Use of this API does not require a API Key.
Session Tokens are unique keys that will help keep track of the questions the API has already retrieved. By appending a Session Token to a API Call, the API will never give you the same question twice.
Once all questions are exhausted, you will have to reset the session or request a new token.
Session Tokens will be deleted after 6 hours of inactivity.
Calls: https://opentdb.com/api_token.php?command=request
The token will look like this: 955ccb0cfee1435e15c1d82cf5ed9528b1ed6fed28353043e8f91f4dcda3cff1