Note: Beagle Security API v1 has been deprecated. We recommend that you upgrade to v2
Get all test sessions under an application
Used to get all the test sessions of a particular application.
API
GEThttps://api.beaglesecurity.com/rest/v2/test/sessions?application_token={application_token}&count={count}
Required scope: read_test_result
Request headers
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
Request body
| Name | Type | Description | Required |
|---|---|---|---|
| application_token | string | A unique token for identifying the application in your account | |
| count | string | Number of test sessions to fetch at once |
Example request
curl --location --request GET \
'https://api.beaglesecurity.com/rest/v2/test/sessions?application_token=c2bzdnqzlwtxer7pczakwr4ly5zas1qa&count=20' \
--header 'Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
// This token will be generated from Beagle security settings -> Access token
BeagleSecurityClient client = BeagleSecurityClientBuilder.instance()
.withAPIToken("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
.build();
// Get test sessions of application
String applicationToken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
List<TestSession> testSession = client.getTestSessions(applicationToken, 20);
Response
| Name | Type | Description |
|---|---|---|
| sessions | array | List of test session objects |
| code | string |
Status code for the API call.
Values are:
SUCCESSAPI call is success
PLAN_NOT_SUPPORTEDYour plan does not support this feature.
INVALID_SESSIONInvalid session
FAILEDFailed to get test sessions.
NOT_AUTHORIZEDUser authentication failed.
|
| message | string | Success/failure message for the API call |
Example response
{
"code": "SUCCESS",
"message": "Success.",
"sessions": [
{
"resultToken": "s14gbjsvghjnicpf7jw09xh91rhf4bxx",
"startTime": 1630742492974,
"endTime": 1630742531775
},
{
"resultToken": "3qy7cuy69nis0lp0p988c0df8om2mn90",
"startTime": 1630740444141,
"endTime": 1630741619924
},
{
"resultToken": "g0einbv7iayf4zdev2rza4vuvp5o5gpa",
"startTime": 1624824208627,
"endTime": 1624829998223
}
]
}
{
"code": "INVALID_APPLICATION_TOKEN",
"message": "Given token is invalid"
}
{
"code": "NOT_AUTHORIZED",
"message": "Not authorized"
}