-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
SDK Version
documenso_sdk (Python) — latest as of 2026-02-28
Description
documenso.envelopes.items.download() throws an error when the Documenso API correctly responds with a PDF file (Content-Type: application/pdf). The SDK does not handle binary responses, interpreting the raw PDF bytes as a text/JSON body and raising an unexpected response error.
Steps to Reproduce
from documenso_sdk import Documenso
import documenso_sdk
with Documenso(api_key="<API_KEY>", server_url="https://sign.example.com") as client:
data = client.envelopes.items.download(
envelope_item_id="envelope_item_xxxxxxxxxxxx",
version=documenso_sdk.EnvelopeItemDownloadVersion.SIGNED,
)Expected Behavior
Returns the signed PDF content as bytes.
Actual Behavior
Unexpected response received: Status 200 Content-Type application/pdf.
Body: %PDF-1.7
%����
1 0 obj
<<
/Type /Pages
...
The SDK treats the raw PDF binary data as an error body and raises an exception.
Workaround
Use the raw REST API directly instead of the SDK:
import requests
resp = requests.get(
f"{base_url}/api/v2/envelope/item/{item_id}/download",
headers={"Authorization": api_key},
timeout=60,
)
pdf_bytes = resp.content #works correctly, returns ~993KB PDFAdditional Notes
- The correct endpoint is
GET /api/v2/envelope/item/{item_id}/download - The
item_idmust be theenvelopeItems[0].idfrom the envelope details, not the envelope ID itself - Passing the envelope ID (e.g.
envelope_xxxxxx) instead of the item ID (e.g.envelope_item_xxxxxx) results in a 404
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels