...
When an access token expires, AGILITY API will no longer accept incoming request and will redirect you to the login page. To handle this situation, we recommend you to always We recommend that you request a new id_token using the refresh token request if it still valid or just re-authenticate.
Use these steps to handle expired tokens and ensure continuous access to the AGILITY API without requiring users to re-authenticate.
To refresh an expired token, follow these steps:
Make a refresh token refresh request: Send a POST request to the token URL with the required parameters to refresh the token. Use the refresh token received during the initial authentication.
Example Request:
Code Block language bash POST /cv/auth/realms/agility/protocol/openid-connect/token Content-Type: application/x-www-form-urlencoded grant_type=refresh_token &refresh_token=[Your Refresh Token] &client_id=d0d8b0d806f9
Receive a new Idid_token: If the refresh token is valid, AGILITY will respond with a new access token and potentially a new refresh token.
Example Response:
Code Block language bash HTTP/1.1 200 OK Content-Type: application/json { "access_token": "[New Access Token]", "expires_in": 300, "token_type": "Bearer", "refresh_token": "[New Refresh Token]", "refresh_expires_in": 1800, "id_token": "[New Id Token]", // ... other token information }
Update your authorization: Use the new access token in your request headers for subsequent API requests.
By following these steps, you can seamlessly handle expired tokens and ensure continuous access to AGILITY APIs without requiring users to re-authenticate.
Note: Remember to securely store and manage the refresh token, as it provides long-term access to the API on your behalf and should be protected from unauthorized access.
Endpoints
1.
...
Retrieve Supported Services
Endpoint: GET /cv/api/v1/services/
...
Code Block | ||
---|---|---|
| ||
curl -X 'GET' \ 'https://cv-dev.b-yond.com/cv/api/v1/services/?page=1&size=50' \ -H 'accept: application/json' \ -H 'Authorization: Bearer YOUR_ID_TOKEN' |
2.
...
Start a New Analysis
Endpoint: POST /cv/api/v1/analysis/file
...
Code Block | ||
---|---|---|
| ||
curl -X 'POST' \ 'https://cv-dev.b-yond.com/cv/api/v1/analysis/file' \ -H 'accept: application/json' \ -H 'Authorization: Bearer YOUR_ID_TOKEN' \ -H 'Content-Type: multipart/form-data' \ -F 'uploadFile=@myfile.pcap' \ -F 'serviceKeys=volte' |
3.
...
Fetch Analysis
...
Results
Endpoint: GET /cv/api/v1/analysis/{analysis_id}/summary
...