2013-09-30 102 views
0

我有興趣從模板中獲取角色以正確填充角色並自動保持最新狀態。獲取模板角色(REST API)

是否有可能通過REST API獲取?

還有「通過ID - v2/accounts /:accountId/templates /:templateId獲取帳戶模板」請求,但它似乎沒有返回有關角色或收件人的有用信息。

回答

1

使用REST API,你可以通過簡單地執行「GET信封收件人」的要求,在這裏您代替信封標識的指定模板ID得到一個模板接受者角色名稱。例如:?

GET https://demo.docusign.net/restapi/v2/accounts/ {帳戶ID} /信封/ {templateId} /收件人include_tabs =假& include_extended =真

對此請求的響應將包含收件人的陣列爲每個收件人類型的對象(即:簽名者,代理人,編輯,中介機構,碳信用卡,認證的供應商,inPersonSigners);每個收件人對象將包含屬性roleName。下面是一個包含3個收件人模板的示例響應 - 2個簽名者和一個CC收件人:

{ 
    "signers": [ 
     { 
      "signInEachLocation": "false", 
      "name": "", 
      "email": "", 
      "recipientId": "5741ec70-b056-44eb-b462-eceee88ddf77", 
      "requireSignerCertificate": "false", 
      "requireIdLookup": "false", 
      "routingOrder": "1", 
      "roleName": "Signer 1", 
      "status": "created", 
      "templateLocked": "false", 
      "templateRequired": "false" 
     }, 
     { 
      "signInEachLocation": "false", 
      "name": "", 
      "email": "", 
      "recipientId": "c64d4567-2efd-422d-9b0a-a5427aa2512d", 
      "requireSignerCertificate": "false", 
      "requireIdLookup": "false", 
      "routingOrder": "2", 
      "roleName": "Signer 2", 
      "status": "created", 
      "templateLocked": "false", 
      "templateRequired": "false" 
     } 
    ], 
    "agents": [], 
    "editors": [], 
    "intermediaries": [], 
    "carbonCopies": [ 
     { 
      "name": "Legal Team", 
      "email": "[email protected]", 
      "recipientId": "a63e3714-adc2-4e05-b2c5-b3c3bbf50aa2", 
      "requireIdLookup": "false", 
      "routingOrder": "3", 
      "roleName": "Legal Team", 
      "status": "created", 
      "templateLocked": "true", 
      "templateRequired": "true" 
     } 
    ], 
    "certifiedDeliveries": [], 
    "inPersonSigners": [], 
    "recipientCount": "3" 
} 
+0

這是意想不到的,謝謝你。 – dgoncharenko

+0

@KimBrandl有什麼方法可以獲取API中模板列表的收件人數據,還是需要單獨調用每個模板? – propagated

+1

使用REST API,您必須分別爲每個模板請求收件人數據。不過,我相信通過SOAP API的「RequestTemplateList」操作,您可以在單個API請求中請求有關多個模板的數據。請參閱SOAP API指南(p213)上的「RequestTemplateList」操作信息(https://10226ec94e53f4ca538f-0035e62ac0d194a46695a3b225d72cc8.ssl.cf2.rackcdn.com/soap-api-guide.pdf)。 –