Page Sections
API Keys list
- In the top-left corner, select your main menu.
- Select
Users and Permissions
. - Select tab
Global API keys
.
Accessing API
To make use of API for Klarity’s App, you require authentication in the form of your Secret Key. To create an API Secret Key please follow the below instruction.
Create API Key
Prerequisite:
- You need to be a Klarity user with
Full access
permissions, to be able to create an API Secret Key both from the API Key list or programmatically.
On the API Keys list view:
- Select
+ Add New Api Key
. - Enter required
Description
and optionalExpiration Date
. - Select required
Role
. - Select
+ Add New Api Key
to confirm creating a new key.
Save the API Secret Key, somewhere safe. After you leave the page, you no longer have access to the key.
Edit API Key
On the API Keys list view:
- Select an icon with three dots on the row with the API key you wish to edit.
- Select
Edit API Key
- Change selected field:
Description
,Expiration Date
orRole
. - Select
+ Edit API Key
to saved the changes.
Recreate API Key
On the API Keys list view:
- Select an icon with three dots on the row with the API key you wish to recreate.
- Select
Recreate API Secret Key
- Confirm the recreation by selecting
Recreate API Secret Key
.
Save the API Secret Key, somewhere safe. After you leave the page, you no longer have access to the key.
Delete API Key
On the API Keys list view:
- Select an icon with three dots on the row with the API key you wish to delete.
- Select
Delete API Key
- Confirm the recreation by selecting
Delete API Key
.
title: API requests from external source
Calling API from external source
To call the API from your local machine or any other external source you need two pieces of information. Endpoint and the API key.
API Endpoint:
https://api.cnop-int.nordcloudapp.com/graphql
API key is generating two values. ID and secret. Both values have to be combined with /
sign in the middle to succesfully authenticate to the API.
API_KEY_ID/API_KEY_SECRET
Examples
Bash
curl -X POST https://api.cnop-int.nordcloudapp.com/graphql \-H 'x-api-key: API_KEY_ID/API_KEY_SECRET' \-H 'content-type: application/json' \-d '{"query": "query exampleQuery {accountsV2(limit: 100, page: 0) {accounts {name}}}"}'
Python
Edit this page on GitHub
import jsonfrom http.client import HTTPExceptionimport requestsKLARITY_URL = 'https://api.cnop-int.nordcloudapp.com/graphql'KLARITY_KEY = 'API_KEY_ID/API_KEY_SECRET'def graphql_query(query: str, variables: dict | None) -> dict:"""Send a GraphQL query to the given URL."""response = requests.post(KLARITY_URL, json={'query': query,'variables': variables}, headers={'x-api-key': KLARITY_KEY})if response.status_code != 200:raise HTTPException(response.text)else:return json.loads(response.text)if __name__ == '__main__':query = '''query exampleQuery {accountsV2(limit: 100, page: 0) {accounts {name}}}'''graphql_query(query)