Docusign 与 MVC 5 Web 应用程序的集成

Docusign integration with MVC 5 Web application

我们正在尝试将 docusign(嵌入式签名/嵌入式 docusign 控制台尚未决定是哪一个)与现有的 MVC 5 Web 应用程序集成。我正在寻找一个起点并遇到了你的问题。我看过 API walkthrough(7,8,9) ,但我想知道如何开始。例如,我们需要将用户引导至申请表,以便他们在网站上注册后填写并签名。 Post 签名 我想将他们重定向回网站。

任何指示或示例将不胜感激。

非常感谢,Sunny

以下是我的代码 - 一直运行到上周五(但从昨天开始我收到此错误 - “406 - 客户端浏览器不接受所请求页面的 MIME 类型。 您正在查找的页面无法被您的浏览器打开,因为它有 您的浏览器不接受的文件扩展名。"

    protected const string IntegratorKey = "XXX-XXX";
    protected const string Environment = "http://demo.docusign.net";
    static void Main(string[] args)
    {
        // Example #1...
        Console.WriteLine("Testing Walkthrough #7...");

        // configure application's integrator key, webservice url, and rest api version
        RestSettings.Instance.IntegratorKey = IntegratorKey;
        RestSettings.Instance.DocuSignAddress = Environment;
        RestSettings.Instance.WebServiceUrl = Environment + "/restapi/v2";

        docusign test = new docusign();
        test.EmbeddedSigning();
        Console.ReadLine(); // pause to show console output
    }

    private void EmbeddedSigning()
    {
        //*****************************************************************
        // ENTER VALUES FOR FOLLOWING VARIABLES!
        //*****************************************************************
        string AccountEmail = "s@something.com";
        string AccountPassword = "*****";
        string EnvelopeId = "xxxxxxx";              
        string RecipientEmail = "s@someone.com";
        string RecipientName = "someone";
        //*****************************************************************

        // user credentials 
        Account account = new Account();
        account.Email = AccountEmail;
        account.Password = AccountPassword;

        // make the login call (retrieves your baseUrl and accountId)
        bool result = account.Login();
        if (!result)
        {
            Console.WriteLine("Login API call failed for user {0}.\nError Code:  {1}\nMessage:  {2}", account.Email, account.RestError.errorCode, account.RestError.message);
            return;
        }

        // create envelope object and assign login info
        Envelope envelope = new Envelope();           
        envelope.Login = account;           
        // assign the envelope id that was passed in
        envelope.EnvelopeId = EnvelopeId;
        //add one signer (single recipient embedded signing currently supported in DocuSign .NET Client)
        envelope.Recipients = new Recipients()
        {
            signers = new Signer[]
            {
                new Signer()
                {
                    email = RecipientEmail,
                    name = RecipientName,
                    recipientId = "1",
                    clientUserId = "1"
                }
            }
        };            

        try
        {
            result = envelope.GetRecipientView("http://example.com/");
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }           
        Console.WriteLine(envelope.SenderViewUrl);

        Console.ReadLine();

        if (!result)
        {
            if (envelope.RestError != null)
            {
                Console.WriteLine("Error code:  {0}\nMessage:  {1}", envelope.RestError.errorCode, envelope.RestError.message);
                Console.ReadLine();
                return;
            }
            else
            {
                Console.WriteLine("Error encountered retrieving signing token, please review your envelope and recipient data.");
                return;
            }
        }
        else
        {
            // open the recipient view (SenderViewUrl field is re-used for the recipient URL)
            Process.Start(envelope.SenderViewUrl);
        }
    }

嵌入式签名

嵌入式签名完全符合您对 returnUrl 参数的要求。这也允许签名者无需注册 DocuSign 帐户即可签名,从而进一步简化流程。

查看 DocuSign 的 Embedded Signing REST API Walkthrough