Resend DocuSign Emails

前端 未结 5 1930
谎友^
谎友^ 2020-12-02 00:18

Is there an API endpoint which allows me to retrigger emails to recipients? Sometimes users may not get or lose the DocuSign emails which contain their signing link. I\'d li

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-02 01:10

    You can use docusign's latest API using nuget package manager "DocuSign.eSign.Api".

    I did it using C#:

    //Very first prepare Recepients:

        Recipients recpnts = new Recipients
                    {
                        //CurrentRoutingOrder = "1", // Optional.
                        Signers = new List()
                    {
                            new Signer
                            {
                                RecipientId = "1",
                                RoleName = "Prospect",
                                Email = "ert@gmail.com",
                                Name = "Shyam",
                            },
                        }
                    };
    // Call Envelopes API class which has UpdateRecepient Method
    
    EnvelopesApi epi = new EnvelopesApi();
    
    var envelopeId ="62501f05-4669-4452-ba14-c837a7696e04";
    
    var accountId = GetAccountId();
    
    // The following Line is responsible for Resend Envelopes.
    
     RecipientsUpdateSummary recSummary = epi.UpdateRecipients(accountId, envelopeId , recpnts);
    
    // Get Status or Error Details.
    
    var summary = recSummary.RecipientUpdateResults.ToList();
    
    var errors = summary.Select(rs => rs.ErrorDetails).ToList();
    
    // Method to get your Docusign Account Details and Authorize it.
    
    private static string GetAccountId()
            {
                string username = "Account Email Address";
                string password = "Account Password;
                string integratorKey = "Your Account Integrator Key";
    
          // your account Integrator Key (found on Preferences -> API page)                                                                
    
    
                ApiClient apiClient = new ApiClient("https://demo.docusign.net/restapi");
                Configuration.Default.ApiClient = apiClient;
    
                // configure 'X-DocuSign-Authentication' header
                string authHeader = "{\"Username\":\"" + username + "\", \"Password\":\"" + password + "\", \"IntegratorKey\":\"" + integratorKey + "\"}";
                Configuration.Default.AddDefaultHeader("X-DocuSign-Authentication", authHeader);
    
                // we will retrieve this from the login API call
                string accountId = null;
    
                /////////////////////////////////////////////////////////////////
                // STEP 1: LOGIN API        
                /////////////////////////////////////////////////////////////////
    
                // login call is available in the authentication api 
                AuthenticationApi authApi = new AuthenticationApi();
                LoginInformation loginInfo = authApi.Login();
    
                accountId = loginInfo.LoginAccounts[0].AccountId;
                return accountId;
            }
    

提交回复
热议问题