Add a URL scan to a Dynamic Analysis with the REST API
You can use the Dynamic Analysis API to add a URL to an existing analysis.
To complete this task:
-
Add the URL to the
scan_config_request
property in the JSON file. -
Ensure the
action_type
property is set toADD
in the JSON file. -
Send the following request to get a list of analyses by name:
http --auth-type=veracode_hmac GET "https://api.veracode.com/was/configservice/v1/analyses/"
-
Send the following request, where
name
is the name of the analysis you want to edit:http --auth-type=veracode_hmac GET "https://api.veracode.com/was/configservice/v1/analyses?name={name}"
-
Obtain the
analysis_id
of the analysis you want to edit. -
Send the following request to add the URL:
http --auth-type=veracode_hmac PUT "https://api.veracode.com/was/configservice/v1/analyses/{analysis_id}?method=PATCH" < input.json
The API passes the JSON file that you populate with the necessary values as shown in this example payload:
{
"name": "Name-of-Your-Dynamic-Analysis",
"scans": [
{
"scan_config_request": {
"target_url": {
"url": "https://www.example.com"
}
},
"action_type": "ADD"
}
]
}