0

I am new with trying to use the DocuSign API. I am having issues trying to run a sample with the code that is available on Git. I have set all properties and I am unable to run any of the samples. When trying to use JWT I get the following exception:

Error while requesting server, received a non successful HTTP code Completed with response Body: {"error":"invalid_grant"}

this.Host = (host != null) ? host : "https://demo.docusign.net/restapi";
this.Username = (username != null) ? username : {my acct email here};
this.Password = (password != null) ? password : {my acct pswd here};
this.IntegratorKey = (integratorKey != null) ? integratorKey : {my integrator key here};

this.RecipientEmail = (recipientEmail != null) ? recipientEmail : {recipient email here};
this.RecipientName = (recipientName != null) ? recipientName : {recipient name here};

this.TemplateRoleName = (templateRoleName != null) ? templateRoleName : "bob"; - DEFALTED NOT ME
this.TemplateId = (templateId != null) ? templateId : "cf2a46c2-8d6e-4258-9d62-752547b1a419"; - DEFAULTED NOT ME

this.ReturnUrl = (returnUrl != null) ? returnUrl : "https://www.docusign.com/devcenter";

this.UserId = {My acct GUID HERE};
this.OAuthBasePath = "account-d.docusign.com";
this.PrivateKeyFilename = "../../../docs/private.pem";
this.ExpiresInHours = 1;

this.EnvelopeIdsList = new List<string>();

this.IntegratorKeyNoConsent = "66750331-ee4b-4ab8-b8ee-6c1a413a6096"; - DEFAULTED NOT ME
this.PrivateKeyNoConsentFilename = "../../../docs/privateKeyConsentReq.pem";

Any help would be grateful! Thanks in advance

payamf1
  • 265
  • 2
  • 11
DWCoder
  • 15
  • 7
  • have you checked the answers for this [post](https://stackoverflow.com/q/39881341/9534819) – Matt.G Mar 01 '19 at 19:06
  • I'm not seeing anything in your code that actually requests a JWT user token, am I missing something? But for the invalid_grant error, check the answer to this: https://stackoverflow.com/questions/54836104/bad-request-message-in-jwt-oauth-authentication-flow/54836708 – Drew Mar 01 '19 at 20:36
  • Check [JWT Example](https://github.com/docusign/docusign-csharp-client/blob/master/test/SdkTests/JwtAuthUnitTests.cs) – Amit K Bist Mar 01 '19 at 21:22

1 Answers1

-1

Please start with the C# Auth Code Grant example. It is a ready-to-run Visual Studio solution.

Larry K
  • 47,808
  • 15
  • 87
  • 140