文档有 textTabs 但它们不会作为 pdf 文档返回

Document has textTabs but they don't get returned with the document as a pdf

我正在使用 api 成功创建包含单个文档的信封。我正在使用 textTabs 将一些信息传递给文档,这工作正常,据我所知,我认为这是进行邮件合并的正确方法。

但是,现在我正在尝试以 PDF 格式取回文档,我取回了它,但它没有 textTabs。为什么会这样?

编辑:这是我创建的信封,我剪掉了一些标签。

<envelopeDefinition xmlns="http://www.docusign.com/restapi">
  <status>sent</status>
  <emailSubject>DocuSign API - Embedded Signing example</emailSubject>
  <enableWetSign>false</enableWetSign>
  <templateId>a5413dda-74a6-40a1-b9c5-de5634ba32ab</templateId>
  <templateRoles>
    <templateRole>
      <email>email@email.com</email>
      <name>Fred Bloggs</name>
      <roleName>Customer</roleName>
      <clientUserId>1</clientUserId>
      <tabs>
        <textTabs>
          <text>
            <anchorString>[DealerName]</anchorString>
            <tabLabel>label</tabLabel>
            <value>Fred Bloggs Dealer</value><font>Arial</font>
            <fontSize>Size10</fontSize>
            <bold>true</bold>
            <locked>true</locked>
            <documentId>1</documentId>
            <pageNumber>1</pageNumber>
          </text>
          <text>
            <anchorString>[DealerABN]</anchorString>
            <tabLabel>label</tabLabel>
            <value>12345678901</value><font>Arial</font>
            <fontSize>Size10</fontSize>
            <bold>true</bold>
            <locked>true</locked>
            <documentId>1</documentId>
            <pageNumber>1</pageNumber>
          </text>
        </textTabs>
      </tabs>
    </templateRole>
  </templateRoles>
</envelopeDefinition>

这很好用,我可以在 docusign 上看到文档中填写的选项卡。

然后我检索文档 uri 并使用以下代码将其作为 PDF 获取,代码取自 API 演练:

Dim url As String = BaseURL + "/envelopes/" + EnvelopeID + "/documents"

Dim request As HttpWebRequest = initializeRequest(url, "GET", Nothing, DocuSignUserName, DocuSignPassword, DocuSignIntegratorKey)

Dim response As String = GetResponseBody(request)

Dim doc As New XmlDocument()
doc.LoadXml(response)
Dim nsmgr As New XmlNamespaceManager(doc.NameTable)
nsmgr.AddNamespace("x", "http://www.docusign.com/restapi")

Dim DocumentUri As String = Nothing
For Each DocumentNode As XmlNode In doc.SelectNodes("x:envelopeDocumentsResult/x:envelopeDocuments/x:envelopeDocument", nsmgr)
    Dim IdNode As XmlNode = DocumentNode.SelectSingleNode("x:documentId", nsmgr)
    If (IdNode IsNot Nothing) Then
        If (String.Compare(IdNode.InnerText, DocumentId, True) = 0) Then
            Dim UriNode As XmlNode = DocumentNode.SelectSingleNode("x:uri", nsmgr)
            If (UriNode IsNot Nothing) Then
                DocumentUri = UriNode.InnerText()
            End If
        End If
    End If
Next

If (DocumentUri = Nothing) Then
    Throw New Exception("DocumentId '" + DocumentId + "' not found")
End If

url = BaseURL + DocumentUri
request = initializeRequest(url, "GET", Nothing, DocuSignUserName, DocuSignPassword, DocuSignIntegratorKey)
request.Accept = "application/pdf"

但是PDF只有模板信息,没有标签

选项卡始终特定于收件人,这意味着选项卡只能分配给收件人,而不能 "belong" 按说分配给文档。如果您想检索选项卡信息,请尝试进行 Get Tab Information for Recipient API 调用。

来自文档的示例请求:

GET https://{server}/restapi/{apiVersion}/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/tabs

X-DocuSign-Authentication: <DocuSignCredentials><Username>{name}</Username><Password>{password}</Password><IntegratorKey>{integrator_key}</IntegratorKey></DocuSignCredentials>
Accept: application/json
Content-Type: application/json

响应示例:

{
  "textTabs":[{
    <Tab information removed>
  }],
  "titleTabs":[{
    <Tab information removed>
  }],
  "signHereTabs":[{
    <Tab information removed>
 }]
}