有没有办法在连接事件中包含模板角色名称

时间:2019-01-18 12:55:11

标签: docusignapi

对于DocuSign,我们有一个集成帐户,我们使用connect事件将有关信封的信息存储在数据库中,然后存储到我们的报告存储库中。对于我们发送的每个信封,我们都会应用一个匹配的模板。有没有办法让模板事件名称包含在推送给我们的连接事件中?

2 个答案:

答案 0 :(得分:0)

Connect事件有效负载没有角色名称作为选项。

但是您可以使用事件有效负载中的envelopeId调用EnvelopeRecipients::list API方法。

您将收到所有信封收件人的回传数据,包括他们的角色名称。响应示例:

{
   agents: [],
   carbonCopies: [
      {
         email: "larry@example.com",
         name: "Larry Kluger",
         note: "",
         recipientId: "2",
         recipientIdGuid: "a31eaf15-48bb-4a40-a8a7-cf28325f1d78",
         requireIdLookup: "false",
         roleName: "cc",  //   <<===
         routingOrder: "2",
         status: "created",
         userId: "00db048f-1dbc-489f-935a-c2d7bc178ca1"
      }
   ],
   certifiedDeliveries: [],
   currentRoutingOrder: "1",
   editors: [],
   inPersonSigners: [],
   intermediaries: [],
   recipientCount: "2",
   seals: [],
   signers: [
      {
         creationReason: "sender",
         deliveryMethod: "email",
         email: "Pat.Edwards@example.com",
         isBulkRecipient: "false",
         name: "Pat Edwards",
         note: "",
         recipientId: "1",
         recipientIdGuid: "f21e3531-277a-4ee1-912b-1d359d342fa7",
         requireIdLookup: "false",
         roleName: "signer",  //   <<===
         routingOrder: "1",
         status: "sent",
         userId: "69e573ac-d2e2-41d0-9ad3-b5e64317942f"
      }
   ]
}

答案 1 :(得分:0)

正如Larry所提到的,我们不在Connect响应中发送roleName,但是如果您使用API​​发送信封,则可以通过差异解决方法来实现。创建信封时,您可以在信封创建调用中传递收件人级别的自定义字段,在此收件人级别的自定义字段中,您可以将roleName作为字符串传递。在“连接响应”中,您将收到每个收件人的“自定义字段”,该字段可用于解释用于创建信封的roleName。

如果API调用的收件人部分如下所示,其中Signer1是您已使用但作为收件人级别自定义字段传递的roleName:

"recipients": {
                  "signers": [
                     {
                        "email": "docusign.sso+internal22@gmail.com",
                        "name": "John Doe",
                        "recipientId": "1",
                        "roleName": "Signer1",
                        "routingOrder": "1",
                        "customFields":[
                            "Signer1"
                        ]
                     }
                  ]
               }

然后连接响应将如下所示:

<RecipientStatus>
        <Type>Signer</Type>
        <Email>johndoeemail@gmail.com</Email>
        <UserName>John Doe</UserName>
        <RoutingOrder>1</RoutingOrder>
        <Sent>2019-03-07T12:14:48.38</Sent>
        <Status>Sent</Status>
        <CustomFields>
          <CustomField>Signer1</CustomField>
        </CustomFields>
</RecipientStatus>