Skip to main content
Question

Is it possible to get JWT access token using single rest API call.

  • September 12, 2024
  • 9 replies
  • 202 views

Forum|alt.badge.img+2

Hi,

Currently to get JWT access token we are following these two steps. 

Step -1: manual action:

Currently to get JWT access token we need to manually prepare JWT JSON and here we need to add start time, expire time and need to generate JWT token.

Step-2: Rest API

From the above generated JWT token we are execute DocuSign API to get the access token “https://account-d.docusign.com/oauth/token?grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=<JWT token>.
 

Is there any way so that with the user credentials/data we need to fire only one API to get the access token no need of again manual generation of JWT token. Is there any way to avoid manual action. 

 

9 replies

Michael.Rave
Docusign Employee
Forum|alt.badge.img+14
  • Docusign Employee
  • 929 replies
  • September 12, 2024

@Harish reddy 

The JWT generation is a 2 step process to create and obtain an access token, as described here. There is no need for any manual steps in the generation to prepare the JWT JSON. You can and should automate all fields like start time and expiration so there is no manual step involved after it has been set up.

The initial consent step is only once and can be removed for the users if you add it as Trusted App in the Admin area.


Forum|alt.badge.img+2
  • Author
  • Newcomer
  • 4 replies
  • September 12, 2024

Thank you @Michael.Rave 


Forum|alt.badge.img+2
  • Author
  • Newcomer
  • 4 replies
  • September 13, 2024

Hi @Michael.Rave ,
Is there any rest API available to generate JWT token from JWT JSON having user credentials , public and private keys, start and expiration times.


Michael.Rave
Docusign Employee
Forum|alt.badge.img+14
  • Docusign Employee
  • 929 replies
  • September 13, 2024

@Harish reddy 

Have you checked the Quickstart and various SDKs available? You can generate JWT token via Postman, C#, Java, PHP, etc.

 


Ivan.Dinkov
Docusign Employee
Forum|alt.badge.img+4
  • Docusign Employee
  • 36 replies
  • September 13, 2024

Hi @Harish reddy to add to Michael’s reply, all SDK’s provide a function/method that allows to get JWT token from a single call. For example the C# SDK method is RequestJWTUserToken 


https://github.com/docusign/docusign-esign-csharp-client/blob/master/sdk/src/DocuSign.eSign/Client/DocuSignClient.cs#L925C33-L925C52

 

I hope this helps

 


Forum|alt.badge.img+2
  • Author
  • Newcomer
  • 4 replies
  • September 16, 2024

Thank you @Michael.Rave , @Ivan.Dinkov ,

 

I need to generate token using postman/http requests only.


Michael.Rave
Docusign Employee
Forum|alt.badge.img+14
  • Docusign Employee
  • 929 replies
  • September 16, 2024

@Harish reddy 

You can download the Docusign Postman Collection for eSignature here. Under “Authentication” you will find the required calls to generate the JWT token.


Forum|alt.badge.img+2
  • Author
  • Newcomer
  • 4 replies
  • September 17, 2024

Thank you @Michael.Rave 


Forum|alt.badge.img
  • Newcomer
  • 1 reply
  • February 12, 2025

Not sure if there is code library where i can refer Azure function implementation for generation of  DocuSign JWT access token generation, ​@Michael.Rave and ​@Ivan.Dinkov can you please help me with that