API Keys
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.
PERMISISONS REQUIRED
The following functional permissions are required to configure API Keys:
Security
|
Configure API Keys
Please follow the steps below to acquire API keys:
- Login to Nue App
- 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}}
In Postman:
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
2. Move "NueExternalCredentials - API Key" to the Enabled colume, and click Save.