Intro to admin API keys
Summarize
Summary of Intro to admin API keys
ServiceNow CPQ allows you to access administrative functionality programmatically via admin API calls, eliminating the need to use the Admin UI browser interface. Admin API keys enable secure API-based access to Admin features, streamlining automation and integration tasks.
Show less
Accessing Admin API Keys
Within ServiceNow CPQ Admin, you can find the Admin API Keys page by expanding the Utilities section. This page lets you manage your admin API keys efficiently.
Creating Admin API Keys
- Name: Assign a meaningful name to identify the key.
- User ID: Specify the user associated with the key.
- Expiration Date: Set when the key will expire to maintain security.
- Permissions: Assign appropriate permissions based on your use case.
Available permissions include:
- Read (required): Read-only access, typically for GET requests.
- Edit: Create, read, update, and delete access for most objects.
- Deploy: Ability to deploy blueprints and access deployment history.
- Bulk: Permissions to import/export data such as managed tables.
- Admin: Full administrative access to all Admin functionality.
- End User Data: Access to end user data APIs.
After assigning permissions, save the key. Important: Copy the API key immediately upon creation, as it cannot be retrieved later.
Using Admin API Keys
Use the API key with Bearer Token authentication in the HTTP Authorization header:
- Header Key: authorization
- Header Value: Bearer <Admin API key>
Example:
authorization: Bearer QdaUdoiYipb15Le11En8axEuN71FA6Vtcw
API Endpoint Differences
When using admin API keys, API endpoints differ slightly from those used in the Admin UI:
- General Admin endpoints change from
/a/Admin/…to/api/Admin/… - Managed table endpoints change from
/a/managedtables/…to/api/managedTables/…
For example:
- Retrieving rules list:
/a/Admin/v3/rules…becomes/api/Admin/v3/rules… - Retrieving managed table schema:
/a/managedtables/v1/managedTables/{tableName}/metadatabecomes/api/managedTables/v1/managedTables/{tableName}/metadata
Related Considerations
Admin API keys offer an alternative authentication method compared to Salesforce-connected app authentication, facilitating flexible admin API access.
You can use admin API calls to access Admin functionality without using the Admin UI interface and a browser.
ServiceNow CPQ provides admin API keys that you can use to access admin functionality via API calls instead of using a browser and the ServiceNow CPQ Admin interface.
For an introduction to ServiceNow CPQ admin API keys, view the following video:
Admin API keys page
To get to the Admin API Keys page in ServiceNow CPQ, click the arrow to expand the Utilities section in ServiceNow CPQ Admin. The Admin API Keys tab appears in the menu.
Add an admin API key
To add a new admin API key, click New at the top of the screen.
All parameters are required.
- Name: the name of the admin API key
- User ID
- Expiration Date: the expiration date of the key
- Permissions: the permissions assigned to the key
Choose the permissions that fit your use case before clicking Save.
Admin API key permissions
- Read (required, default): read-only access, typically for GET requests
- Edit: create, read, update, and delete access for most objects, including fields and rules
- Deploy: allows the deployment of blueprints and access to deployment history
- Bulk: allows importing and exporting data, such as managed tables, to and from ServiceNow CPQ
- Admin: full permissions to all Admin functionality
- End User Data: access to end user data APIs
When you are finished assigning permissions, click Save. The dialog box updates to show the new admin API key.
- View the admin API key
- Copy the key to the clipboard
- Close the dialog box
Accessing admin APIs by using API keys
To use an admin API key in API requests, use the API key with Bearer Token authentication.
- Header: Authorization Header
- Key: authorization
- Value: Bearer <Admin API key>
Example header:
authorization: Bearer Qda_UdoiYipb15Le11En8axEuN71FA6Vt_cw
When you use an admin API key, you use different endpoints to access the admin APIs.
- For general Admin endpoints (
/a/Admin/…) the endpoint to use is (/api/Admin/…).For example (retrieving a list of rules):
- API call in Admin UI:
/a/Admin/v3/rules?page=0&size=100&sort=modified%2CDESC - API call using Admin Keys:
/api/Admin/v3/rules?page=0&size=100&sort=modified%2CDESC
- API call in Admin UI:
- For managed table endpoints (
/a/managed_tables/…) the endpoint to use when accessing with an API key is (/api/managedTables/…)For example (retrieving the schema of a managed table):
- API call in Admin UI:
/a/managed_tables/v1/managedTables/{tableName}/metadata - API call using Admin Keys:
/api/managedTables/v1/managedTables/{tableName}/metadata
- API call in Admin UI: