From 82fcdd3c77649731db807540a37b2acf1d53a9fa Mon Sep 17 00:00:00 2001 From: Abhishek Pandey <91930405+bird-03@users.noreply.github.com> Date: Fri, 10 Oct 2025 13:34:11 +0530 Subject: [PATCH 1/2] Create getSubscriptionKey.js This BG script will be helpful to fetch the subscription key for any API to view key value if forget, store and update if required for doc purpose This will use GlideEncrypter and Decrypted API --- .../RetrieveAPIKey/getSubscriptionKey.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Server-Side Components/Background Scripts/RetrieveAPIKey/getSubscriptionKey.js diff --git a/Server-Side Components/Background Scripts/RetrieveAPIKey/getSubscriptionKey.js b/Server-Side Components/Background Scripts/RetrieveAPIKey/getSubscriptionKey.js new file mode 100644 index 0000000000..5a43d568ef --- /dev/null +++ b/Server-Side Components/Background Scripts/RetrieveAPIKey/getSubscriptionKey.js @@ -0,0 +1,13 @@ +/* +This BG script will be helpful to fetch the subscription key for any API to view key value if forget, store and update if required for doc purpose + +This will use GlideEncrypter and Decrypter API +*/ +var gr = new GlideRecord('api_key_credentials'); + gr.addQuery('name', ' '); // Replace with your credential name + gr.query(); + if (gr.next()) { + var encryptedApiKey = gr.api_key; // Assuming 'api_key' is the field name + var decryptedApiKey = new GlideEncrypter().decrypt(encryptedApiKey); + gs.info("Decrypted API Key: " + decryptedApiKey); + } From af36d11efb9df09dd676fbc15bf3a1e60f99972e Mon Sep 17 00:00:00 2001 From: Abhishek Pandey <91930405+bird-03@users.noreply.github.com> Date: Fri, 10 Oct 2025 13:35:36 +0530 Subject: [PATCH 2/2] Create Readme.md This BG script will be helpful to fetch the subscription key for any API to view key value if forget, store and update if required for doc purpose This will use GlideEncrypter and Decrypted API to fetch the API keys --- .../Background Scripts/RetrieveAPIKey/Readme.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Server-Side Components/Background Scripts/RetrieveAPIKey/Readme.md diff --git a/Server-Side Components/Background Scripts/RetrieveAPIKey/Readme.md b/Server-Side Components/Background Scripts/RetrieveAPIKey/Readme.md new file mode 100644 index 0000000000..1557a1280d --- /dev/null +++ b/Server-Side Components/Background Scripts/RetrieveAPIKey/Readme.md @@ -0,0 +1,3 @@ +This BG script will be helpful to fetch the subscription key for any API to view key value if forget, store and update if required for doc purpose + +This will use GlideEncrypter and Decrypter API.