当前位置: 动力学知识库 > 问答 > 编程问答 >

docusignapi - Docusign view only document is not going to the correct recipients

问题描述:

I have one document that I am sending to 3 people to view only. I am using the REST api. It's giving me an error "ENVELOPE_IS_INCOMPLETE". Here is the bad request:

`Host: demo.docusign.net

X-DocuSign-Authentication: {"Username":"[email protected]","Password":"[omitted]","IntegratorKey":"[omitted]"}

X-Forwarded-For: 63.118.233.100, 165.225.34.90

{

"recipients": {

"signers": [

{

"name": "Kathy Keaton",

"email": "[email protected]",

"routingOrder": "1",

"roleName": "##Buyer1"

},

{

"name": "Kathy xxx",

"email": "[email protected]",

"routingOrder": "2",

"roleName": "##Seller1"

},

{

"name": "Kathy Lloyd",

"email": "[email protected]",

"routingOrder": "3",

"roleName": "##RealEstateAgent"

}

]

},

"compositeTemplates": [

{

"serverTemplates": [

{

"sequence": "1",

"templateId": "1796af9e-06b2-463e-9b34-45dcee11653c"

}

]

}

],

"status": "sent",

"emailSubject": "Please Sign the enclosed docs at your earliest convenience"

}

400 BadRequest

Content-Type: application/json; charset=utf-8

X-DocuSign-TraceToken: d3964cc9-2470-408a-bcc8-0b160fa3a32e

{

"errorCode": "ENVELOPE_IS_INCOMPLETE",

"message": "The Envelope is not Complete. A Complete Envelope Requires Documents, Recipients, Tabs, and a Subject Line."

}`

There is no signing here, just viewing. There is a document, I have recipients and a subject line. Any idea where I could be going wrong? Thanks.

网友答案:

When you're using the compositeTemplates structure in the API request, the recipients need to be specified within an inlineTemplates object, as follows:

{  
  "compositeTemplates": [
    {
      "serverTemplates": [
        {
          "sequence": "1",
          "templateId": "1796af9e-06b2-463e-9b34-45dcee11653c"
        }
      ],
      "inlineTemplates": [
        {
           "sequence" : 2,
           "recipients": {
               "signers":[
                  {
                    "name": "Kathy Keaton",
                    "email": "[email protected]",
                    "routingOrder": "1",
                    "roleName": "##Buyer1",
                    "recipientId": "1"
                  },
                  {
                    "name": "Kathy xxx",
                    "email": "[email protected]",
                    "routingOrder": "2",
                    "roleName": "##Seller1",
                    "recipientId": "2"
                  },
                  {
                    "name": "Kathy Lloyd",
                    "email": "[email protected]",
                    "routingOrder": "3",
                    "roleName": "##RealEstateAgent",
                    "recipientId": "3"
                  }            
               ]
           }
        }]    
    }
  ],
  "status": "sent",
  "emailSubject": "Please Sign the enclosed docs at your earliest convenience"
}

Also worth mentioning that if you're simply needing to specify recipient information for roles that are already defined by the (single) template, then a simpler way of doing so would be this:

{  
   "templateId": "1796af9e-06b2-463e-9b34-45dcee11653c"    
   "templateRoles":[
      {
        "name": "Kathy Keaton",
        "email": "[email protected]",
        "routingOrder": "1",
        "roleName": "##Buyer1"
      },
      {
        "name": "Kathy xxx",
        "email": "[email protected]",
        "routingOrder": "2",
        "roleName": "##Seller1"
      },
      {
        "name": "Kathy Lloyd",
        "email": "[email protected]",
        "routingOrder": "3",
        "roleName": "##RealEstateAgent"
      }            
   ], 
   "status": "sent",
   "emailSubject": "Please Sign the enclosed docs at your earliest convenience"
} 

Note: Both of the above Request bodies should give you the same result. The compositeTemplates structure (as shown in the first Request) enables you to do things like create an Envelope that uses multiple templates, etc. -- but if you're simply creating an envelope from a single template, then the second Request shows a simpler way of doing that (i.e., without using the compositeTemplates structure).

分享给朋友:
您可能感兴趣的文章:
随机阅读: