Jeff Jeff - 3 months ago 19
reST (reStructuredText) Question

Uploading Bulk Recipients File Through DocuSign Rest API

The DocuSign documentation gives this example for uploading a csv file through their rest api. Below the image is the request object I'm trying but getting an error that says 'Value cannot be null. Parameter name: stream'. The example I posted doesn't actually try and send a csv. When I tried attaching csv formatted text to the body of the request I got a different error that told me that the request body was invalid.

enter image description here

REQUEST OBJECT
enter image description here

Answer

Seems like the example request that DocuSign provides in the documentation is incorrect. Try changing the value of the Content-Type request header to text/csv (instead of application/json).

Here's an example of the full request (including verb/endpoint, headers, and body):

PUT https://demo.docusign.net/restapi/v2/accounts/ACCOUNT_ID/envelopes/ENVELOPE_ID/recipients/RECIPIENT_ID/bulk_recipients

Content-Type: text/csv
Accept: application/json
Content-Disposition: file;filename=dsbulk.csv;fileExtension=.csv
X-Docusign-Authentication: {"Username":"USERNAME","Password":"PASSWORD","IntegratorKey":"INTEGRATOR_KEY"}

email,name
john.doe@test.com,John Doe
jane.doe@test.com,Jane Doe

This example request successfully updates/adds the specified bulk recipient info to the (draft) Envelope's bulk recipient signer.