CreateChunkedUpload sends Content-Type: multipart/form-data without boundary (regression since v10.0.0)
Summary Since v10.0.0,
EnvelopesApi.CreateChunkedUploadsends a request withContent-Type: multipart/form-databut noboundaryparameter, on a body that is actually JSON. DocuSign rejects it with a 400. Works fine up to v9.0.0; broken in v10.0.0 and v11.0.0.Error returned by DocuSign
400 - {"errorCode":"ENVELOPE_IS_INCOMPLETE","message":"The Envelope is not Complete. A Complete Envelope Requires Documents, Recipients, Tabs, and a Subject Line. Content-Type does not contain boundary parameter."}Root cause (traced in the SDK source)
- In
Api/EnvelopesApi.cs, theconsumesarray forCreateChunkedUploadchanged from empty{ }(≤ v9.0.0) to{ "multipart/form-data" }(v10.0.0+):String[] localVarHttpContentTypes = new String[] { "multipart/form-data" }; String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
SelectHeaderContentType(inClient/DocuSignClient.cs) returns the first type whenapplication/jsonisn't present, so it returns"multipart/form-data".- But the
ChunkedUploadRequestbody is still serialized as JSON, and inClient/SystemNetHttpClient.csit is wrapped as a plainStringContent:requestMessage.Content = new StringContent(request.BodyContent.ToString(), System.Text.Encoding.UTF8, contentType); // contentType == "multipart/form-data"
StringContentdoes not generate a multipart boundary — onlyMultipartFormDataContentdoes, and that branch is only reached whenFileParamsare present. Chunked upload has none, so the request goes out asmultipart/form-data; charset=utf-8with no boundary, on a JSON body → server rejects it.Affected versions: v10.0.0, v11.0.0 — Last working version: v9.0.0
Expected fix The
consumesfor thechunked_uploads:createoperation should beapplication/json, notmultipart/form-data(likely an error in the DocuSign OpenAPI spec that propagated to the generated SDK).ChunkedUploadRequestcarries its content as a base64 field inside a JSON body, so the operation does not use multipart.Workaround: pin
DocuSign.eSignto v9.0.0.
@yBouzeliffa I am part of the developer support team at Docusign, I have raised this issue for engineering to review. The reference is: DCM-16624
Hi @yBouzeliffa , Please check v11.0.1. The issue should be fixed in the same.
@yBouzeliffa closing this as fixed, please re-open if you still need assistance
i confirm that the fix is working, thank you for the quick response.