问题
I'm trying to integrate with a bare bones application but I keep running into this error after applying our integration key and making sure our application not only looked at the Demo API but as well was DEMO within the dashboard.
DocuSign.eSign.Client.ApiException: 'Error calling Login: {
"errorCode": "PARTNER_AUTHENTICATION_FAILED",
"message": "The specified Integrator Key was not found or is disabled. An Integrator key was not specified."
I verified that all the credentials are exactly as displayed and all have been correct. The apiclient is the correct value to pass to the demo if I am correct. Nothing has been changed from the sample other then the parameters I need to throw in anyway. The application is exactly what the example is of:
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;
回答1:
Nick,
The culprit is the following code :
var authApi = new AuthenticationApi(config);
Instead, don't specify the configuration. Try this, it will fix your error :
var authApi = new AuthenticationApi();
The reason is that you already specified the API configuration in your code with the following line :
Configuration.Default.ApiClient = apiClient;
来源:https://stackoverflow.com/questions/46530130/errorcode-partner-authentication-failed