400 Client Error: Bad Request for url /api/packages/{package_id}/documents/{document_id}
Thursday, August 10, 2023 at 08:46pmHi there, I'm trying to delete a document in python but I'm getting this return:
400 Client Error: Bad Request for url: https://sandbox.esignlive.com/api/packages/TAv__TLL2MOR_bMTDTnmiq0boLU=/documents/28
I don't understand why this problem is happening, I registered the package with the following payload:
{"roles": [{"id": "Role1", "signers": [{"email": "[email protected]", "firstName": "Matheus", "lastName": "Delecrode Andrade", "company": "JumpLabel", "id": "Role1"}]}], "documents": [{"approvals": [{"role": "Role1", "fields": [{"page": 0, "top": 0, "subtype": "FULLNAME", "height": 50, "left": 0, "width": 200, "type": "SIGNATURE"}]}], "name": "DataTables example - File export.pdf", "id": 28}, {"approvals": [{"role": "Role1", "fields": [{"page": 0, "top": 0, "subtype": "FULLNAME", "height": 50, "left": 0, "width": 200, "type": "SIGNATURE"}]}], "name": "document1.pdf", "id": 29}], "name": "Teste", "type": "PACKAGE", "language": "en", "emailMessage": "Segue para assinatura o acordo de servi\u00e7o.", "description": "Envio de documento para assinatura", "autocomplete": true, "status": "DRAFT"}
I'm sending everything right, the document_id is the same as the one I sent
Reply to: 400 Client Error: Bad Request for url /api/packages/{package_id}/documents/{document_id}
Friday, August 11, 2023 at 08:38amHi Matheus,
Your transaction is currently in SENT status, that's probably why you can't delete the document. Try to change the transaction status to DRAFT with a PUT call first:
PUT /api/packages/{packageId}
{"status":"DRAFT"}
Duo
Reply to: 400 Client Error: Bad Request for url /api/packages/{package_id}/documents/{document_id}
Friday, August 11, 2023 at 01:12pmThank you!!