bluesky_queueserver_api.http.REManagerAPI.session_refresh

REManagerAPI.session_refresh(*, refresh_token=None)

Refresh session using valid refresh token. If the client is successfully authenticated or configured to use tokens, then the API will use the existing refresh token stored in REManagerAPI.auth_key. The refresh token may also be set using REManagerAPI.set_authorization_key()`. The API is not using the access token, which could be expired, invalid or missing. Alternatively, the refresh token may be passed with the API parameter. In this case the internally stored refresh token is ignored. If successful, the API call automatically updates access and refresh tokens in REManagerAPI.auth_key.

Note

It is not necessary to refresh the session during normal operation. If the access token is valid, but expired, and the refresh token is valid, the client will refresh the expired session automatically. Auto refresh will not work if the access token is invalid or missing. If only refresh token is available, then explicitly call REManagerAPI.session_refresh() API to obtain valid access token.

Parameters:
refresh_token: str or None

Valid refresh token or None. If the parameter is omitted or None, then the token stored in REManagerAPI.auth_key is used. If no refresh token passed or stored by the class, the RequestParameterError is raised.

Returns:
dict

See the description of REManagerAPI.login() API for the list of keys.

Raises:
RequestParameterError

Invalid parameter type or value.

HTTPRequestError, HTTPClientError, HTTPServerError

Error while sending and processing HTTP request.