Approve a mitigation with the REST API
Send the following request to approve a mitigation proposal, with a comment, for an application with two findings.
Before you begin
- To authenticate with Veracode, ensure you have set up API authentication for HMAC or OAuth 2.0.
- To get the GUID for an application profile, use the Applications API.
Veracode HMAC authentication
- Windows (PowerShell)
- macOS, Linux, or UNIX
Get-Content input.json | http --auth-type=veracode_hmac POST "https://api.veracode.com/appsec/v2/applications/{application_guid}/annotations"
http --auth-type=veracode_hmac POST "https://api.veracode.com/appsec/v2/applications/{application_guid}/annotations" < input.json
OAuth 2.0 Client Credentials authentication
- Windows (PowerShell)
- macOS, Linux, or UNIX
Get-Content input.json | http --auth-type=oauth2-client-credentials-flow `
--auth="$($env:VERACODE_CLIENT_ID):$($env:VERACODE_CLIENT_SECRET)" `
--token-endpoint="$($env:VERACODE_TOKEN_URL)" `
--token-request-type=basic POST "https://api.veracode.com/appsec/v2/applications/{application_guid}/annotations"
http --auth-type=oauth2-client-credentials-flow \
--auth="$VERACODE_CLIENT_ID:$VERACODE_CLIENT_SECRET" \
--token-endpoint="$VERACODE_TOKEN_URL" \
--token-request-type=basic POST "https://api.veracode.com/appsec/v2/applications/{application_guid}/annotations" < input.json
Request payload
The API passes the JSON file that you populate with the necessary values as shown in this example payload:
{
"issue_list": "1,2",
"comment": "This is my comment",
"action": "ACCEPTED"
}
Properties
| Name | Type | Description |
|---|---|---|
issue_list Required | String | Comma-separated list of finding IDs. You can use the Findings API to get a list of finding IDs for an application. |
comment Required | String | Enter a brief comment about the findings for issue_list. |