Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using DocuSign.eSign.Api;
  8. using DocuSign.eSign.Model;
  9. using DocuSign.eSign.Client;
  10.  
  11. namespace WebApplication4
  12. {
  13. public partial class About : System.Web.UI.Page
  14. {
  15. protected void Page_Load(object sender, EventArgs e)
  16. {
  17. SendAPiCall();
  18. }
  19. public void SendAPiCall()
  20. {
  21. string username = "[*]";
  22. string password = "[*]";
  23. string integratorKey = "[*]";
  24.  
  25. ApiClient apiClient = new ApiClient("https://demo.docusign.net/restapi");
  26. Configuration.Default.ApiClient = apiClient;
  27.  
  28. var config = new Configuration(apiClient);
  29. var authApi = new AuthenticationApi(config);
  30.  
  31.  
  32. string authHeader = "{"Username":"" + username + "", "Password":"" + password + "", "IntegratorKey":"" + integratorKey + ""}";
  33. Configuration.Default.AddDefaultHeader("X-DocuSign-Authentication", authHeader);
  34.  
  35. // we will retrieve this from the login API call
  36. string accountId = null;
  37.  
  38. /////////////////////////////////////////////////////////////////
  39. // STEP 1: LOGIN API
  40. /////////////////////////////////////////////////////////////////
  41.  
  42. // login call is available in the authentication api
  43. LoginInformation loginInfo = authApi.Login();
  44.  
  45. // parse the first account ID that is returned (user might belong to multiple accounts)
  46. accountId = loginInfo.LoginAccounts[0].AccountId;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement