2017-08-16 1 views
0

Ich habe Problem mit Docusign.It sagtDocusign kann sich nicht anmelden. Wie logge ich mich in C# -Code ein?

DocuSign.eSign.Client.ApiException: ‚Fehler beim Aufruf Anmeldung: {

"errorcode": "PARTNER_AUTHENTICATION_FAILED",

"message":„Die Der angegebene Integratorschlüssel wurde nicht gefunden oder ist deaktiviert. "

Hier ist mein Code

// 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(); 

Ich habe meinen gültigen Benutzernamen, Passwort und integratorKey eingegeben und es funktioniert nicht. Ich habe meinen Integratorschlüssel aus dem Admin-Panel kopiert. Ich habe zwei Schlüssel erzeugt, beide haben den Status DEMO mit der grauen Taste vor dem Wort DEMO, aber keiner funktioniert. Was muss ich tun, damit es funktioniert? Was ist das Problem?

Antwort

2

Sie vermissen die Anweisung Configuration.Default.ApiClient = apiClient;

Siehe das Beispiel aus dem offiziellen 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(); 
-1

Sie benötigen ein Config Objekt zu bauen und dann in den Auth-Header in die AuthenticationApi passieren etwa so:

var apiClient = new ApiClient("https://demo.docusign.net/restapi"); 
var config = new Configuration(apiClient); 
var authApi = new AuthenticationApi(config); 

Auch hier in dieser Linie, Sie haben zwei Semikolons:

string username="[Email]";; 

Remove einer von ihnen.

Verwandte Themen