通过重定向进行 DocuSign 集成

问题描述 投票:0回答:1

TL:DR - 有没有办法通过我的应用程序和 DocuSign 之间的重定向来创建信封,而不是使用 REST API?

我想通过以下方式在我的应用程序和 DocuSign 之间创建集成:

  1. 我的应用程序中的用户上传文档,然后单击名为“使用 DocuSign 发送”的按钮。
  2. 用户被重定向到他的 DocuSign 帐户以准备信封(假设他已经通过身份验证)。
  3. 在 DocuSign 页面中,文档已预先填充,用户可以向信封添加选项卡和收件人。
  4. 用户在 DocuSign 中单击“发送”,信封发送给收件人,用户会重定向回我的应用程序,并显示有关信封状态的一些指示。

可以吗?

我尝试查看 DocuSign 文档,但没有找到任何关于我描述的工作流程存在的确认,即使我看到一些应用程序在做完全相同的事情。

docusignapi
1个回答
0
投票

是的,您可以做到这一点,并且这个确切的场景不仅有记录,而且我们还用八种语言展示了如何做到这一点。

如何从您的应用程序发送信封(嵌入式发送)

请注意,您确实需要使用电子签名 REST API 来执行此操作,我不知道在不使用 API 的情况下执行此操作的方法。也许 Microsoft PowerApps(或逻辑应用程序)之类的东西具有此功能,但您仍将在幕后使用 REST API。

我强烈建议您尝试使用您选择的代码下载快速入门,然后选择“嵌入式发送”代码示例以向您展示其工作原理。

这里是一些 C# 代码(因为你没有说出什么编码语言):

    public static string SendEnvelopeUsingEmbeddedSending(string signerEmail, string signerName, string ccEmail, string ccName, string docDocx, string docPdf, string accessToken, string basePath, string accountId, string startingView, string returnUrl)
    {
        var docuSignClient = new DocuSignClient(basePath);
        docuSignClient.Configuration.DefaultHeader.Add("Authorization", "Bearer " + accessToken);
        EnvelopesApi envelopesApi = new EnvelopesApi(docuSignClient);

        // Step 1. Make the envelope with "created" (draft) status
        EnvelopeDefinition env = MakeEnvelope(signerEmail, signerName, ccEmail, ccName, docDocx, docPdf, "created");
        EnvelopeSummary results = envelopesApi.CreateEnvelope(accountId, env);
        string envelopeId = results.EnvelopeId;

        // Step 2. create the sender view
        // Call the CreateSenderView API
        // Exceptions will be caught by the calling function
        ReturnUrlRequest viewRequest = new ReturnUrlRequest
        {
            ReturnUrl = returnUrl,
        };
        ViewUrl result1 = envelopesApi.CreateSenderView(accountId, envelopeId, viewRequest);

        // Switch to Recipient and Documents view if requested by the user
        string redirectUrl = result1.Url;
        Console.WriteLine("startingView: " + startingView);
        if ("recipient".Equals(startingView))
        {
            redirectUrl = redirectUrl.Replace("send=1", "send=0");
        }

        return redirectUrl;
    }
© www.soinside.com 2019 - 2024. All rights reserved.