REST API with inline API key in API url
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2022 05:12 AM
I need to store an API key so that it can be reused for multiple REST APIs. I went to Credentials and Aliases and I configured a new credential there. The REST APIs I'm integrating with require the API Key to be part of an XML request that is sent via query parameters. When I go to build my REST API up and go to use this credential that I've saved ServiceNow tells me that the credential is 2 way encrypted and I cannot use the credential where I want to use it. My question is, what is the proper way to save API Keys that are sent via URL's in REST API requests?
I'm creating custom Flow Designer Actions using the REST step and I'm using the Get Connection Info step to retrieve my credential.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2022 08:56 AM
I was able to solve this by creating a script include in the global scope, using GlideDecrypter and allowing the script to be called from all scopes and then adding a script step to my custom Flow Designer Action where that calls the global script include and decrypts the API key. I then pass that as an output to my REST step.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2023 02:52 PM
Hi Frank Hale,
please help me sharing above sample scripts to creating a script include in the global scope, using GlideDecrypter and allowing the script to be called from all scopes and then adding a script step to my custom Flow Designer Action where that calls the global script include and decrypts the API key.