cpierce | Posts: 1

Content Transfer Encoding for /api/packages

0 votes
I'm having trouble sending a PDF with text tags to the /api/packages endpoint. My PDF is sent as base-64 encoded, and that string is "pasted" into a document when it reaches my eSignLive account. I'd like for the string to be decoded, so that the new package contains a copy of my original PDF. Here's what the request looks like: Request: POST : https://sandbox.esignlive.com/api/packages Accept: application/json Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW Authorization: Basic *obscured* ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="file"; filename="sample-contract.pdf" Content-Type: application/pdf JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAgUiAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAGFkU1LAzEQhu/5FW+31ibqZiff6VXx4q0Q8OB6WupBqFD3/4PT3UrJYSkJJAPJPPPMnL ... etc. ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="payload" { "documents": [ { "id": "sample-contract", "name": "Test Document", "extract": true, "data": { "esl_doc_extract_type": 1 } } ], "status": "DRAFT", "type": "PACKAGE", "roles": [ { "id": "signer1", "type": "SIGNER", "signers": [ { "email": "[email protected]", "firstName": "Cam", "lastName": "Pierce", "id": "signer1" } ], "name": "signer1" } ], "name": "Text Tags Example Package" } ------WebKitFormBoundary7MA4YWxkTrZu0gW-- And the string within the name="file" boundary is what gets pasted into my new document. Is the API expecting my PDF to arrive in a different format/encoding? How can I construct my call so that my new package contains the PDF as it looks before it's sent over?

harishaidary | Posts: 1812

Reply to: Content Transfer Encoding for /api/packages

0 votes
Hi there, In your multipart/form-data request, you will need to send the actual bytes of the pdf rather than the base64 representation of it.

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