2016-12-20 28 views
0

我有一個文件,我發送給3人只能查看。我正在使用REST API。它給了我一個錯誤「ENVELOPE_IS_INCOMPLETE」。這是不好的要求:Docusign查看唯一文檔不會去正確的收件人

`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." 
}` 

這裏沒有簽字,只是查看。有一個文件,我有收件人和主題行。任何想法,我可能會出錯?謝謝。

回答

1

當你使用compositeTemplates結構的API請求,收件人需要進行一個inlineTemplates中指定對象,如下所示:

{ 
    "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" 
} 

另外值得一提的是,如果你只需要指定已由(單個)模板定義的角色的收件人信息,那麼更簡單的方式就是:

{ 
    "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" 
} 

注意:上述兩個請求體都應該給你相同的結果。 compositeTemplates結構(如第一個請求中所示)可讓您執行諸如創建使用多個模板等的Envelope的操作 - 但如果您只是從單個模板創建信封,則第二個Request會顯示一個更簡單的方法(即,不使用compositeTemplates結構)。

+0

非常感謝Kim的幫助。複合模板答案的一個小問題 - 您必須爲簽署者設置recipientId。記錄告訴我這一點。我很高興你回答了我的問題。 templateRoles和Signers的這些細微差別是一個很大的混淆,但它現在有意義。 –

+0

我還有最後一個問題:我在一個信封,2個服務器模板,2個簽名者,簽名者A和簽名者B中有一個複合模板。我想要的是簽名者A看到第一個文檔,簽名,然後第一個文檔去簽名B和B簽署後,A得到第二個文檔。但是我看到的是簽名者A同時獲得兩份文檔。如何補救這個? –

+0

我已經更新了答案,在第一個示例中包含「recipientId」。重新提出你的另一個問題 - 聽起來你可能想要在路由順序中添加兩次簽名者A(首先是收件人#1,再次是收件人#3) - 您需要將「allowRecipientRecursion」屬性設置爲「true 「讓信封做這項工作。然後,您可以使用「文檔可見性」功能來指定哪些收件人可以看到哪些文檔 - 更多信息,請訪問:https://www.docusign.com/supportdocs/cdse-user-guide/Content/advanced-sending/ using-document-visibility.htm –

相關問題