简体   繁体   English

DocuSign - 查看表单数据

[英]DocuSign - View Form Data

Another company we partner with sends us new client information via DocuSign envelopes completed by those clients.我们合作的另一家公司通过这些客户填写的 DocuSign 信封向我们发送新的客户信息。 I am attempting to extract the form data from the document, either via the PDF or via the DocuSign API. The PDF only appears to have the Envelope ID embedded in it.我正在尝试通过 PDF 或通过 DocuSign API 从文档中提取表单数据。PDF 似乎只嵌入了信封 ID。 When I add my account as a CC recipient and try to view the form data in the DocuSign console, I receive an error message:当我将我的帐户添加为 CC 收件人并尝试在 DocuSign 控制台中查看表单数据时,我收到一条错误消息:

无法访问表单数据。您没有访问此数据的必要权限。

Additionally, I'm unable to view the form data via the DocuSign API.此外,我无法通过 DocuSign API 查看表单数据。

{
  errorCode: "USER_LACKS_PERMISSIONS",
  message: "This user lacks sufficient permissions to access this resource."
}

I've tried accessing via the API at:我试过通过 API 访问:

  • /v2/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/tabs /v2/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/tabs
  • /v2/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/fields /v2/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/fields

Questions:问题:

  1. Is there a way for a user who is not in the sender's tenant to be able to view the envelope form data?有没有办法让不在发件人租户中的用户能够查看信封表单数据?
  2. Is there a way for DocuSign to embed the tab data into the PDF for extraction? DocuSign 有没有办法将标签数据嵌入到 PDF 中进行提取?
  3. Is there another approach I'm not considering?还有其他我没有考虑的方法吗?

If the user is cc to the envelope using the same userId and email combination that is on their account, then that user also can use the API to gain account information.如果用户使用其帐户中的相同用户 ID 和 email 组合抄送信封,则该用户也可以使用 API 获取帐户信息。 (account is what you call "tenant.") (帐户就是您所说的“租户”。)

If the user is not on the envelope and you just receive the PDF some other way, then you cannot use the API to obtain information about the envelope because that is limited only to recipients of the envelope.如果用户不在信封上,而您只是通过其他方式收到 PDF,那么您不能使用 API 获取有关信封的信息,因为这仅限于信封的收件人。

@Inbar-Gazit was kind enough to do some digging internally at DocuSign, and after a bit of back-and-forth, discovered that this is possible using the SOAP API with the RequestEnvelope and RequestEnvelopeV2 methods. @Inbar-Gazit 很友好地在 DocuSign 进行了一些内部挖掘,经过一些来回的交流,发现可以使用 SOAP API 和 RequestEnvelope 和 RequestEnvelopeV2 方法。 I'm unsure if there's any advantage to using one method over the other.我不确定使用一种方法是否比另一种方法有任何优势。 Both also have async methods.两者都有异步方法。

https://developers.docusign.com/docs/esign-soap-api/reference/Status-and-Managing-Group/RequestEnvelope https://developers.docusign.com/docs/esign-soap-api/reference/Status-and-Managing-Group/RequestEnvelope

Some quick-and-dirty C# validated that this will indeed work.一些快速而肮脏的 C# 验证了这确实有效。 I validated this both as the sending account (which also works via REST) and the CC recipient account (which did not work via REST).我将其验证为发送帐户(也可以通过 REST 工作)和 CC 收件人帐户(不能通过 REST 工作)。

var authString = $"<DocuSignCredentials><Username>{_userName}</Username><Password>{_password}</Password><IntegratorKey>{_apiKey}</IntegratorKey></DocuSignCredentials>";

var client = new DSAPIServiceSoapClient();

using (OperationContextScope scope = new OperationContextScope(client.InnerChannel))
{
    HttpRequestMessageProperty httpRequestProperty = new HttpRequestMessageProperty();
    httpRequestProperty.Headers.Add("X-DocuSign-Authentication", authString);
    OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = httpRequestProperty;

    EnvelopeStatus status = client.RequestStatusEx(_envelopeId);
    Console.Out.WriteLine("Subject: " + status.Subject);

    // RequestEnvelope Method
    var envelope = client.RequestEnvelope(_envelopeId, false);
    var testTab = envelope.Tabs.FirstOrDefault(t => t.TabLabel.Contains("Test"));
    if (testTab != null)
    {
        Console.WriteLine($"Tab {testTab.TabLabel}: {testTab.Value}");
    } else
    {
        Console.WriteLine("Tab not found.");
    }

    // RequestEnvelopeV2 Method
    var requestOptions = new RequestEnvelopeV2Options() {
        IncludeAC = false,
        IncludeAnchorTabLocations = true,
        IncludeDocumentBytes = false
    };
    var envelopeV2 = client.RequestEnvelopeV2(_envelopeId, requestOptions);
    var testTabV2 = envelopeV2.Tabs.FirstOrDefault(t => t.TabLabel.Contains("Test"));
    if (testTabV2 != null)
    {
        Console.WriteLine($"Tab(v2) {testTabV2.TabLabel}: {testTabV2.Value}");
    } else
    {
        Console.WriteLine("Tab(v2) not found.");
    }

    Console.WriteLine("\r\nDone.");
    Console.ReadKey();
}

Output: Output:

Subject: Please DocuSign: Test Envelope
Tab txtDataLabelTest1: Some Data Here
Tab(v2) txtDataLabelTest1: Some Data Here

Done.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM