Deleting a Project (8.0.0)

The API client can delete an existing project and all its related scans. All scans that are currently running are stopped and deleted together with the project. If there's there is a single scan/project that cannot be deleted (due to security reasons) the operation will fail and an error message will be issued. 


cxSDKProxy.DeleteProjects Method

 

public CxWSBasicRepsonse DeleteProjects(
   string sessionID,
   long projectID,
   DeleteProjects DeleteProjects
);

Parameters

  • sessionID: The current Session ID
  • projectID: The Project ID of the project to be deleted. Can be obtained from the server response upon running a scan.

If there were any errors set CxWSBasicRepsonse.IsSuccesfull to false and specify the error in the CxWSBasicRepsonse.ErrorMessage

Example

To delete an existing project and its related scans:

internal void Main(string [] args)
{
  String sessionID = args[0];
  CxSDKWebService cxSDKProxy = new CxSDKWebService();

  //the projects unique id 
  long[] projectsIDs = new long[]{1,2,3};

  //cancel the scan
  CxWSBasicRepsonse response = cxSDKProxy.DeleteProjects(sessionID, projectsIDs);
 
  //operate by the response's result
  if (!response.IsSuccesfull)
{
log(response.ErrorMessage);
}