Auto Refresh DocuSign Token
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2023 01:16 AM - edited 07-04-2023 01:17 AM
Hi,
I have configured the DocuSign Spoke according to the document content.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0852804
And I have also got the token of DocuSign, but this token will expire after one hour, I would like to know if there is any way to automatically update this token instead of manually updating it every time, thanks.
Labels:
- Labels:
-
Human Resources Service Delivery
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2023 05:07 AM
For a similar integration I am doing the following:
- Created an API Key Credential record [api_key_credentials] --> the token will be stored
- I store the token in the 'api_key' field of this credential record, which is 2 way encrypted.
- I have a flow (could be scheduled job as well, but for us the integration is built as a custom IntegrationHub spoke too) which runs every 30 minutes and refreshes the token. By refresh, I mean:
- Send a REST request to an endpoint with basic auth to get the token
- Parse the response header that stores the token
- Encrypt the token (as it is scoped, it is done with gs.base64Encode())
- Update the api_key field of the credential record with the encrypted string
- Any other custom actions I have with a REST step that needs the token can simply take it from the API Key Credential record, decode and use it (much better performance then requesting a token every time).
Hope it helps or gives you some ideas to create your own solution.
