API Keys
11 min
an api key serves as a unique identifier and authentication token used to access and interact with an application programming interface (api) it acts as a passcode, allowing authorized users or applications to make requests to the api securely api keys are commonly used to authenticate api requests, ensuring that only authorized users or systems can access the api's functionality and data they provide a simple and effective way to manage access control and track usage of api resources it's recommended to utilize api keys for authenticating api requests to nue when a request lacks a valid api key, nue will respond with an error indicating the request is invalid if a request contains a deleted or expired key, nue will return an authentication error additionally, nue automatically generates a default api key for each tenant furthermore, nue's integration with salesforce, stripe, and quickbooks relies on a master api key for making callouts to nue actions permissions required the following functional permissions are required to configure api keys security view api keys manage api keys configure api keys please follow the steps below to acquire api keys login to nue app https //app nue io click on settings → in the settings search box, search for 'api keys' reveal an api key mouse over the api key column and click on the "reveal" button enter your login password to reveal the key for security purposes click to copy the api key to the clipboard authenticate nue api request with api key after the api key is copied to the clipboard, paste the api key to the request header as follows replace {{new api key}} with the pasted api key post /revenue/async/graphql host api nue io content type application/json nue api key {{nue api key}} you now have the capability to utilize nue apis by employing the api key the accessibility to resources is determined by the permissions assigned to the api key rotate api keys for enhanced security measures, it's recommended to rotate an api key regularly or once it's deemed compromised rotating an api key makes the current key invalid and generates a new one you have the choice to rotate the api key instantly or create a replacement key and then revoke the original one after a specified period to rotate the key, simply click on the "rotate api key" action icon if there's a expiration date displayed below the key name, it means the key can't be rotated further keys already expired won't be visible in the api key list anymore you can still access the request logs of the previous key using the replacement key when you rotate the key, the new one becomes immediately operational, regardless of the expiration time of the old key opting for "now" as the expiration time will instantly expire the original key use api key in salesforce it is recommended to use api key in salesforce to access nue, especially in the following scenarios when multi factor authentication (mfa) is enabled in nue; when you have a need to integrate nue with an external system from salesforce to use nue api key in salesforce, please follow the steps below configure api key in external credentials add principal into permission set change custom settings configure api key in external credentials please follow the steps below to configure the api key navigate to setup and search named credentials click external credentials click to open nue external credentials in the principals section, click 'edit' in the actions to edit the api key parameter in the modal popup of 'edit principal', click add to add a new authentication parameter enter the name exactly as apikey paste the api key click 'save' update custom setting please follow the steps below to configure system settings 1\ navigate to setup → custom settings → nue system setting, and click manage 2\ select nueplatformnamecredential, and click edit 3\ change the row value to ruby nueplatformbuilder and then click save add named principals in the permission set after successfully configuring the named principal that includes the api key, you must include it in a designated permission set 1\ navigate to permission sets and select a permission set, for example, nue custom system administrator , which is a clone of nue system administrator permission set 2\ select external credential principal access, and click edit 3\ move "nueexternalcredentials api key" to the enabled colume, and click save for non admin users 1\ please clone either the prebuilt permission set nue basic or nue sales rep 2\ follow the above steps to add the named credentials to the cloned permission set 3\ assign it to the dedicated users, such as sales reps 4\ or include the cloned permission set in the permission set groups that your organization uses (please refer to this on the prebuilt nue permission set groups)