servant
servant

Reputation: 15

Recipients Not Provided error from DocuSign API using composite template

I am embedding the signing of a set of documents in a web application. Ultimately, the documents will be filled in with answers provided during an online interview. Three or four documents are needed in the envelope. The documents are server-based templates. In the template definitions I have left the name and email fields blank for the Applicant role (signer), as they are generic templates that will be used by many applicants.

In a test scenario, I can load a single template in an envelope and carry it through the process, but when I convert to a composite template, I get the error "errorCode": "RECIPIENTS_NOT_PROVIDED", "message": "No recipients were found in the request." from the envelope request. I have compared the code to many examples and haven't been able to see anything different. There has to be something basic that I'm missing--not surprising, as this is my first attempt with the DocuSign API. Can someone please enlighten me?

The failing code:

{
    "accountId":"xxxxxxx",
    "emailSubject":"WOTC Certification Documents - Test Dummy",
    "emailBlurb":"Documentation to be submitted by Consultant",
    "status":"sent",
    "compositTemplates":{
        "serverTemplates":[{
            "sequence":"1",
            "templateId":"ca18aba4-49bd-4c28-9dce-fbd2dd3fbb7b",
            "recipients":{
                "signers":{
                    "name":"Test Dummy",
                    "roleName":"Applicant",
                    "recipientId":"1",
                    "clientUserId":"Dummy1234",
                    "email":"[email protected]"
                }
            }
        },{
            "sequence":"2",
            "templateId":"5ed3d600-5a57-4fee-931f-53233858dc65",
            "recipients":{
                "signers":{
                    "name":"Test Dummy",
                    "roleName":"Applicant",
                    "clientUserId":"Dummy1234",
                    "email":"[email protected]"
                }
            }
        }]
    }
}

Thank you.

Upvotes: 0

Views: 953

Answers (1)

Kim Brandl
Kim Brandl

Reputation: 13500

You're on the right track, but I'd suggest you make the following changes to the JSON that you've posted:

  • "compositTemplates" is missing an "e" -- should be compositeTemplates
  • compositeTemplates needs to be an Array of objects
  • each object within the compositeTemplates Array needs to contain a serverTemplates property (an Array that specifies the template info) and an inlineTemplates property (an Array that specifies the recipient info)
  • within each recipients object, signers needs to be an Array of objects
  • each signer object needs a recipientId property

Here's your JSON again, modified to implement the changes I've listed above:

{
    "accountId":"xxxxxxx",
    "emailSubject":"WOTC Certification Documents - Test Dummy",
    "emailBlurb":"Documentation to be submitted by Consultant",
    "status":"sent",
    "compositeTemplates":[
    {
        "serverTemplates":[
        {
            "sequence":"1",
            "templateId":"ca18aba4-49bd-4c28-9dce-fbd2dd3fbb7b"
        }],
        "inlineTemplates":[
        {
            "sequence" : 2,
            "recipients":{
                "signers":[{
                    "name":"Test Dummy",
                    "roleName":"Applicant",
                    "recipientId":"1",
                    "clientUserId":"Dummy1234",
                    "email":"[email protected]"
                }]
            }
        }],
    },
    {
        "serverTemplates":[
        {
            "sequence" : 3,
            "templateId":"5ed3d600-5a57-4fee-931f-53233858dc65"
        }],
        "inlineTemplates":[
        {
            "sequence" : 4,
            "recipients": {
                "signers" : [{
                    "name":"Test Dummy",
                    "roleName":"Applicant",
                    "recipientId": "1",
                    "clientUserId":"Dummy1234",
                    "email":"[email protected]"
                }]
            }
        }]
    }]
}

Upvotes: 2

Related Questions