Docusign无法登录。如何登录C#代码? [英] Docusign can't login. How to login in C# code?
问题描述
我在使用Docusign时遇到问题。它说
I have problem with Docusign.It says
DocuSign.eSign.Client.ApiException:调用登录时出错:{
DocuSign.eSign.Client.ApiException: 'Error calling Login: {
errorCode: PARTNER_AUTHENTICATION_FAILED,
"errorCode": "PARTNER_AUTHENTICATION_FAILED",
消息:未找到或禁用了指定的集成商密钥。
"message": "The specified Integrator Key was not found or is disabled."
这是我的代码
// initialize client for desired environment (for production change to www)
var apiClient = new ApiClient("https://demo.docusign.net/restapi");
string username="[Email]";;
string password="[Password]";
string integratorKey="[IntegratorKey]";
// configure 'X-DocuSign-Authentication' header
var authHeader = "{\"Username\":\"" + username + "\", \"Password\":\"" + password + "\", \"IntegratorKey\":\"" + integratorKey + "\"}";
Configuration.Default.AddDefaultHeader("X-DocuSign-Authentication", authHeader);
// login call is available in the authentication api
var authApi = new AuthenticationApi();
var loginInfo = authApi.Login();
我已经输入了有效的用户名,密码和integratorKey,但该输入无效。我已经从管理面板复制了集成商密钥。我已经生成了两个键,两个键的状态都为DEMO,并且在单词DEMO之前都带有灰色按钮,但是没有一个起作用。我应该怎么做才能使它正常工作?有什么问题?
I have entered my valid username,password and integratorKey and it's not working. I have copied my integrator key from admin panel. I have generated two key both have status DEMO with grey button before word DEMO but none is working. What should I do to make it work ?What is the problem ?
推荐答案
您缺少语句 Configuration.Default.ApiClient = apiClient;
请参阅官方SDK中的示例此处
See the example from the official SDK here
// initialize client for desired environment (for production change to www)
var apiClient = new ApiClient("https://demo.docusign.net/restapi");
Configuration.Default.ApiClient = apiClient;
string username="[Email]";
string password="[Password]";
string integratorKey="[IntegratorKey]";
// configure 'X-DocuSign-Authentication' header
var authHeader = "{\"Username\":\"" + username + "\", \"Password\":\"" + password + "\", \"IntegratorKey\":\"" + integratorKey + "\"}";
Configuration.Default.AddDefaultHeader("X-DocuSign-Authentication", authHeader);
// login call is available in the authentication api
var authApi = new AuthenticationApi();
LoginInformation loginInfo = authApi.Login();
这篇关于Docusign无法登录。如何登录C#代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!