“errorCode”:“PARTNER_AUTHENTICATION_FAILED”

时间:2017-10-02 16:56:18

标签: docusignapi

我正在尝试与裸机应用程序集成,但是在应用我们的集成键并确保我们的应用程序不仅查看了演示API以及仪表板内的DEMO时,我仍然遇到此错误。

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."

我确认所有凭据都与所显示的完全一致,并且所有凭据都是正确的。如果我是正确的,apiclient是传递给demo的正确值。除了我需要抛出的参数之外,没有任何改变。该应用程序正是以下示例:

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 个答案:

答案 0 :(得分:1)

尼克,

罪魁祸首是以下代码:

var authApi = new AuthenticationApi(config);

相反,请勿指定配置。试试这个,它会解决你的错误:

var authApi = new AuthenticationApi();

原因是您已使用以下行在代码中指定了API配置:

Configuration.Default.ApiClient = apiClient;