Note: Beagle Security API v1 has been deprecated. We recommend that you upgrade to v2
Get test result in JSON format
Used to get the result of a completed test in JSON format.
API
GEThttps://api.beaglesecurity.com/rest/v2/test/result?application_token={applicationToken}&result_token={result_token}
Required scope: run_test
Request headers
| Name | Value |
|---|---|
| Authorization | Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
Request parameters
| Name | Type | Description | Required |
|---|---|---|---|
| application_token | string | A unique token for identifying the application in your account | |
| result_token | string | A unique key for identifying the result session |
Example request
curl --location --request GET \
'https://api.beaglesecurity.com/rest/v2/test/result?application_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&result_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
// This token will be generated from Beagle security settings -> Access token
BeagleSecurityClient client = BeagleSecurityClientBuilder.instance()
.withAPIToken("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
.build();
// Get test result
String applicationToken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
String resultToken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
TestStatus testStatus = client.getTestResultJson(applicationToken, resultToken);
Response
| Name | Type | Description |
|---|---|---|
| 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 result.
NOT_AUTHORIZEDUser authentication failed.
|
| message | string | Success/failure message for the API call |
| result | string | Test result in JSON format |
Example response
{
"code": "SUCCESS",
"message": "Test result returned successfully",
"result": "{\n \"project_name\": \"teststage\",\n \"application_name\": \"test stage\",\n \"url\": \"http://example.com\",\n \"generated_date\": \"04 Sep 2021\",\n \"approved_date\": \"04 Sep 2021\",\n\n.\n.\n.\n-headers that disclose information.\\n* Removing any unnecessary comments.\\n* Removing all the META and generator tags\",\n \"occurences\": [\n {\n \"status\": \"Fixed\",\n \"vulnerability\": {\n \"Method\": \"get\",\n \"Url\": \"http://example.com/Templatize.asp\"\n }\n }\n ]\n \n ]\n}",
}
{
"code": "INVALID_SESSION",
"message": "Given token is invalid"
}
{
"code": "NOT_AUTHORIZED",
"message": "Not authorized"
}