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)
Tagged:
1