Hi All, I have created the secret key in the NetSu...
# suitescript
c
Hi All, I have created the secret key in the NetSuite UI under setup > company > API Secrets. How can we get/load the secret key in the script. I didn't find any method to retrieve it.
I found that, there is a keycontrol module but It only loads the keys but not API secret keys.
b
you dont retrierve secrets using netsuite's apis
suitescript modules like N/https and N/crypto have methods to use secrets without revealing its contents to the script
c
Thanks @battk for the response. I have a query that, few API's will have private key and public keys which we need to maintain securely and never expose to the script. My question is Which is the best place to store these keys in the NetSuite and retrieve them while making post request to third party sites.
b
first attempt should be using N/https to use those api secrets
1
c
For these do I need to create the API secret keys in the UI and give that internalid to make the request via https post call?
b
yes
c
Thankyou!
b
its more script id than internal id, but the basic idea is that you are generating a template for N/https to use
c
Why do we need template since the API secret key list already available in the NetSuite. Can't we use the same keys by loading them using it's id provided by the secret key during it's creation. I could also see the option that during creation of secret key in the UI it also have an checkbox option to access via all scripts.
b
netsuite needs to know where in the request to place your secret
all of the inputs to N/https are strings
and all of the mechanisms for specifying where to use the secret are basically template strings
👍 1
c
Thanks for the Info battk.