The createsandbox.do call creates a sandbox for the specified application. If you have already reached the maximum number of sandboxes for the application, this call fails.
Before
using this API, Veracode strongly recommends that you read API Usage and Access
Guidelines.
Resource URL
https://analysiscenter.veracode.com/api/5.0/createsandbox.do
Parameters
Name | Type | Description |
---|---|---|
app_id Required |
Integer | Application ID. |
sandbox_name Required |
String | Name of the sandbox. |
auto_recreate | Boolean | If true, creates a new sandbox with the same name when the current sandbox expires. Default is false. |
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/createsandbox.do" "app_id==<app id>" "sandbox_name==Project Security"
HTTPie Results
The createsandbox.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.
<?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>"> <sandbox sandbox_id="<sandbox id>" sandbox_name="Project Security" sandbox_status="sandbox" owner="<Veracodeusername>" modified_date="2019-09-17T14:08:35-04:00" created_date="2019-09-17T14:08:35-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>
If you exceed the maximum number of sandboxes for the application, the return
contains:
<?xml version="1.0" encoding="UTF-8"?> <error>An application can have up to 25 sandboxes. To create a new sandbox, you must delete one.</error>