You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Delete file REST API - Groovy

Summary:

Has anyone successfully used the Delete Files (v2) API in a groovy business rule?


Content (required):

I am able to make the API call from Postman.

However I keep getting a validation error when trying to create the same API call in a groovy rule


Version (include the version you are using, if applicable):

22.09.51

Code Snippet (add any code snippets that support your topic, if applicable):

def deleteFile (String fileName, String connection) {


   def deleteFile = new JSONObject()

     .put("fileName",fileName)

     .toString()

    

   HttpResponse<String> deleteResponse = operation.application

   .getConnection(connection)

   .delete("/interop/rest/v2/files/delete")

   .header("Content-Type","application/json")

   .body(deleteFile)

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!