RachaelMead

Error updating attachment status to Rejected

0 votes

I've been following this tutorial: https://community.onespan.com/documentation/onespan-sign/guides/feature-guides/developer/attachment-requirements

I am attempting to reject and attachment with the Rest API, however whenever I call PUT to /api/packages/{packageId}/roles/{roleId}

with request: 

{
  "attachmentRequirements": [
    {
      "id": "{attachementId},
      "status": "REJECTED",
      "comment": "Invalid copy."
    }
  ]
}

I get the following error response:

{
"technical": "Attachments cannot be updated because the transaction is no longer editable.",
"messageKey": "error.validation.updateAttachments.notEditablePackage",
"message": "Attachments cannot be updated because the transaction is no longer editable.",
"code": 400,
"name": "Validation Error"
}

how do I avoid receiving this error and update the package with a rejected attachment?


Reply to: Error updating attachment status to Rejected

0 votes

Hi there,

 

I can reproduce the same with your payload, from my test, it seems the minimal payload should include below fields:

{
  "attachmentRequirements": [
    {
      "comment": "",
      "description": "attachment desc",
      "required": false,
      "status": "REJECTED",
      "id": "AaUZAk6Ap6E2",
      "name": "attachment name"
    }
  ]
}

If your application doesn't store all these information, you can invoke a GET request to pull role data first 

GET /api/packages/{packageId}/roles/{roleId}

Then loop through the "attachmentRequirements" node and get the corresponding attachment JSON by ID.

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off