If the specified sandbox build scans successfully, the promotesandbox.do call promotes the build to be the policy scan for the application.
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. See Using HTTPie with the Python Authentication Library.
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. See the sandboxinfo.xsd schema documentation.
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>