curl --location --request GET \
'https://api.beaglesecurity.com/rest/v2/projects' \
--header 'Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
// This token will be generated from Beagle security settings -> Access token
BeagleSecurityClient client = BeagleSecurityClientBuilder.instance()
.withAPIToken("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
.build();
// Gets all the projects and its applications under a user
List<ProjectWithApplication> projects = client.getAllProjects();
{
"code": "SUCCESS",
"message": "Success",
"projects":
[
{
"name": "Default project",
"description": "New project",
"projectKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"applications": [
{
"name": "Default application",
"url": "http://196.168.0.7:80",
"applicationToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"applicationType": "API",
"signatureStatus": "Verified",
"hostingType": "internal"
},
{
"name": "Default application 2",
"url": "http://example.com",
"applicationToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"applicationType": "WEB",
"signatureStatus": "NotVerified",
"hostingType": "public"
},
]
},
{
"name": "Default project 2",
"description": "New project",
"projectKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"applications": [
{
"name": "Default application 3",
"url": "http://example2.com",
"applicationToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"applicationType": "WEB",
"signatureStatus": "Verified",
"hostingType": "public"
}
]
}
]
}
{
"code": "FAILED",
"message": "Failed to get projects."
}
{
"code": "NOT_AUTHORIZED",
"message": "Not authorized"
}