Configure Java API wrapper parameters
You can configure the API wrapper parameters to specify your API credentials, the actions to perform, and to add parameters.
Before you begin:
- You have installed the Veracode Java API wrapper.
- You have set up API authentication for HMAC.
- You have installed any dependencies.
To complete this task:
-
Enter this command:
java -jar vosp-api-wrapper-java{version}.jar -vid {Veracode API ID} -vkey {Veracode API key} -action {action}We recommend that you use an external API credentials file to provide your credentials to the API wrapper. When you use an API credentials file, you can omit the
-vidand-vkeyparameters for specifying your API credentials.For a list of valid actions, run this command with the
-helpparameter:java -jar vosp-api-wrapper-java{version}.jar -help -
Review the parsing errors window to identify missing parameters or invalid arguments.
-
To add missing parameters, run this command:
java -jar vosp-api-wrapper-java{version}.jar -vid {Veracode API ID} -vkey {Veracode API key} -action {action} -{param1} {arg1} -{param2} {arg2}…where,
{param}is a missing parameter and{arg}is the corresponding argument. -
Optionally, to provide the filepath of a CSV file from which to read additional command-line arguments, include the parameter
-inputfilepath. The correct format of the CSV file is to enter the parameter names in the first row and the corresponding values of those parameters in the subsequent rows. You can useinputfilepathto make multiple calls to the API specified by the action. In the CSV file, use one row to specify the parameters for each call. For an example, seecreateuser.do.The wrapper returns a zero (integer) exit code when a command succeeds.
The wrapper returns a non-zero (integer) exit code when a command fails:
1= Invalid input.2= API internal error.3= Incorrect file format of the CSV file referred to in the-inputfilepathparameter.4= The scan did not pass policy compliance. This code only applies to anuploadandscancomposite action that specifies thescantimeoutparameter.
The Veracode API wrappers return errors for missing required parameters and unrecognized parameters. The API wrappers do not return errors on defined API parameters that are not valid for use with the specified action. For example, if an API wrapper takes
sandboxidas an optional parameter, and you supplysandboxnamein error, the API wrapper executes, but ignoressandboxname. You can verify the list of valid parameters in the console or XML APIs.You can also reference the Java API wrapper from Eclipse or Visual Studio.