Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using DocuSign.eSign.Api;
- using DocuSign.eSign.Model;
- using DocuSign.eSign.Client;
- namespace WebApplication4
- {
- public partial class About : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- SendAPiCall();
- }
- public void SendAPiCall()
- {
- string username = "[*]";
- string password = "[*]";
- string integratorKey = "[*]";
- ApiClient apiClient = new ApiClient("https://demo.docusign.net/restapi");
- Configuration.Default.ApiClient = apiClient;
- var config = new Configuration(apiClient);
- var authApi = new AuthenticationApi(config);
- 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
- LoginInformation loginInfo = authApi.Login();
- // parse the first account ID that is returned (user might belong to multiple accounts)
- accountId = loginInfo.LoginAccounts[0].AccountId;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement