Error updating attachment status to Rejected
Tuesday, June 2, 2020 at 03:39pmI'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
Wednesday, June 3, 2020 at 09:12amHi 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