Josh
Josh

Reputation: 9

Error making call "Invalid multi part request" Docusign API

I am new to API's in general and I was hoping to get another pair of eyes on this. I have a document I am sending through the call and want to apply a template I've created. Everything worked until I tweaked the XML to handle the composite template. I'm not sure if there is something wrong with the nested information. If I have it in an improper sequence. Any help you all are willing to lend is much appreciated.

 string xmlBody =
                    "<envelopeDefinition xmlns=\"http://www.docusign.com/restapi\">" +
                   "<emailSubject>Docusign this Document</emailSubject>" +
                    "<status>Sent</status>" +
                    "<compositeTemplates>" +
                    "<compositeTemplate>" +
                        "<serverTemplates>" +
                        "<serverTemplate>" +
                                "<sequence>1</sequence>" +
                                "<templateId>MY+TemplateID</templateId>" +
                        "<serverTemplate>" +
                        "</serverTemplates>" +
                        "<inlineTemplates>" +
                            "<inlineTemplate>" +
                                "<sequence>2</sequence>" +
                                "<recipients>" +
                                    "<signers>" +
                                        "<signer>" +
                                            "<roleName>Sub</roleName>" +
                                            "<recipientId>1</recipientId>" +
                                            "<email>[email protected]</email>" +
                                            "<name>John Doe</name>" +
                                        "</signer>" +
                                        "<signer>" +
                                            "<roleName>Con</roleName>" +
                                            "<recipientId>2</recipientId>" +
                                            "<email>[email protected]</email>" +
                                            "<name>John Smith</name>" +
                                        "</signer>" +
                                    "</signers>" +
                                "</recipients>" +
                            "</inlineTemplate>" +
                        "</inlineTemplates>" +
                        "<document>" +
                            "<name>" + documentName + "</name>" +
                            "<documentId>1</documentId>" +
                        "</document>" +
                    "</compositeTemplate>" +
                "</compositeTemplates>" +
                    "</envelopeDefinition>";

Upvotes: 0

Views: 224

Answers (1)

Paul Mobilio
Paul Mobilio

Reputation: 151

When posting questions it is helpful to share the specific XML/JSON of the HTTPS request including the headers and endpoint that you are calling. You should ALSO post specific error messages/response messages that you receive from the API call.

What it looks like is you are not creating a multipart request in fact. Please share the SOAP header/endpoint and the actual raw XML (not the stringify code) so that the error can be identified. Thanks! Paul

Upvotes: 1

Related Questions