docusign-esign-csharp-client icon indicating copy to clipboard operation
docusign-esign-csharp-client copied to clipboard

CreateChunkedUpload sends Content-Type: multipart/form-data without boundary (regression since v10.0.0)

Open yBouzeliffa opened this issue 5 months ago • 1 comments

Summary Since v10.0.0, EnvelopesApi.CreateChunkedUpload sends a request with Content-Type: multipart/form-data but no boundary parameter, 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)

  1. In Api/EnvelopesApi.cs, the consumes array for CreateChunkedUpload changed 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);
  1. SelectHeaderContentType (in Client/DocuSignClient.cs) returns the first type when application/json isn't present, so it returns "multipart/form-data".
  2. But the ChunkedUploadRequest body is still serialized as JSON, and in Client/SystemNetHttpClient.cs it is wrapped as a plain StringContent:
requestMessage.Content = new StringContent(request.BodyContent.ToString(), System.Text.Encoding.UTF8, contentType);
// contentType == "multipart/form-data"

StringContent does not generate a multipart boundary — only MultipartFormDataContent does, and that branch is only reached when FileParams are present. Chunked upload has none, so the request goes out as multipart/form-data; charset=utf-8 with 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 consumes for the chunked_uploads:create operation should be application/json, not multipart/form-data (likely an error in the DocuSign OpenAPI spec that propagated to the generated SDK). ChunkedUploadRequest carries its content as a base64 field inside a JSON body, so the operation does not use multipart.

Workaround: pin DocuSign.eSign to v9.0.0.

yBouzeliffa avatar Jun 29 '26 12:06 yBouzeliffa

@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

troywdocusign avatar Jun 29 '26 23:06 troywdocusign

Hi @yBouzeliffa , Please check v11.0.1. The issue should be fixed in the same.

garg-mudit avatar Jul 01 '26 12:07 garg-mudit

@yBouzeliffa closing this as fixed, please re-open if you still need assistance

InbarGazit avatar Jul 01 '26 15:07 InbarGazit

i confirm that the fix is working, thank you for the quick response.

yBouzeliffa avatar Jul 02 '26 15:07 yBouzeliffa