matheusdelecrode | Posts: 12

400 Client Error: Bad Request for url /api/packages/{package_id}/documents/{document_id}

0 votes

Hi 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


Approved Answer
Duo_Liang | Posts: 3776

Reply to: 400 Client Error: Bad Request for url /api/packages/{package_id}/documents/{document_id}

1 votes

Hi 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


matheusdelecrode | Posts: 12

Reply to: 400 Client Error: Bad Request for url /api/packages/{package_id}/documents/{document_id}

0 votes

Thank you!!


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