promotesandbox.do
If the specified sandbox build scans successfully, the promotesandbox.do
call promotes the build to be the policy scan for the application.
Before using this API, Veracode strongly recommends that you read API usage and access guidelines. Ensure you access the APIs with the domain for your region.
REST API equivalent
The REST API equivalent of this call is a POST
to /appsec/v1/applications/{applicationGuid}/sandboxes/{sandboxGuid}/promote
using the Development Sandbox API. Veracode strongly recommends that you use the REST API for this action. For new integrations, always use the REST APIs.
Resource URL
https://analysiscenter.veracode.com/api/5.0/promotesandbox.do
Parameters
Name | Type | Description |
---|---|---|
build_id Required | Integer | ID of the latest build for the target sandbox. |
delete_on_promote | Boolean | If true , deletes the sandbox after its promotion. Default is false . |
You can identify your build_id
by calling getbuildlist.do
.
HTTPie example
Examples use the HTTPie command-line tool.
http --auth-type=veracode_hmac "https://analysiscenter.veracode.com/api/5.0/promotesandbox.do" "build_id==<build id>"
HTTPie results
The promotesandbox.do
call returns the sandboxinfo
XML document, which references the sandboxinfo.xsd
schema file. You can use the XSD schema file to validate the XML data.
In the returned XML, the sandbox_status="policy"
attribute indicates that the API successfully promoted the sandbox build.
<?xml version="1.0" encoding="UTF-8"?>
<sandboxinfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://analysiscenter.veracode.com/schema/4.0/sandboxinfo"
xsi:schemaLocation="https://analysiscenter.veracode.com/schema/4.0/sandboxinfo
https://analysiscenter.veracode.com/resource/4.0/sandboxinfo.xsd" sandboxinfo_version="1.2"
account_id="<account id>" app_id="<app id>" build_id="<build id>" analysis_id="4978995" analysis_unit_id="4994637">
<sandbox sandbox_id="<sandbox id>" sandbox_status="policy" owner="<Veracodeusername>"
modified_date="2019-09-18T17:11:45-04:00" created_date="2019-09-18T17:11:45-04:00">
<customfield name="Custom 1" value=""/>
<customfield name="Custom 2" value=""/>
<customfield name="Custom 3" value=""/>
<customfield name="Custom 4" value=""/>
<customfield name="Custom 5" value=""/>
</sandbox>
</sandboxinfo>