Kryon public API
A public API (Application Programming Interface) acts like a connector between software applications, enabling them to talk and exchange information. GraphQL, a robust language for APIs, is used to communicate with the Kryon public API, enhancing the ability to request and handle data, ensuring ease and efficiency in API interactions.
Queries in GraphQL define the available operations that you can perform on your GraphQL API. They specify the structure of the data you can request and retrieve from the API. With queries, you can define the specific information you want to retrieve from the API, allowing you to ask for exactly what you need and receive a tailored response.
-
Read query: A read query in GraphQL is used to retrieve data from a GraphQL API. It allows you to fetch and read data without making any changes. You specify the fields and relationships of the data you want to retrieve and receive a response with the requested data.
Example:getQueue (queue: GetQueueInput!): Queue
getQueues (queues: GetQueuesInput!): [Queue]
getTaskById (taskId: ID!, tenantId: ID): TaskState
getTrigger (trigger: GetTriggerInput!): Trigger
getWizards (wizards: GetWizardsInput!): [Wizard]
-
Mutation/edit query: In GraphQL, a mutation, like an edit query, changes or updates data on the API, resembling traditional API actions such as HTTP POST, PATCH, PUT, or DELETE requests. It allows you to create, update, or delete data by specifying which parts of the information you want to change and what values to use. The response you get indicates if the changes worked, ensuring consistent modifications.
Example:addQueue (queue: AddQueueInput): Queue
updateQueue (queue: UpdateQueueInput): Queue
addTask (task: AddTaskInput!): Task
reassignTaskToQueue (task: ReassignTaskToQueueInput!): Task
The GraphQL API schema serves as a blueprint, outlining the structure and functionality of our public APIs. It provides a clear overview of available data types, queries, and mutations, to guide you on how to interact with our APIs.
In GraphQL, using square brackets [ ] indicates a list, and the exclamation mark ! means non-nullable.
[Status!]!: The outer ! ensures that the API always returns a list (even if it's empty), and that the returned list will not be null.
Status!: The inner ! ensures that each element within the list is a non-nullable Status object. This guarantees that there won't be null values within the list, and any attempt to include null values would result in a failed query.
scalar Any
input SortDescriptor {
field : String!,
dir: SortDirection!
}
input QueryInput {
filter: FilterDescriptorType!
skip: Int,
sort: [SortDescriptor]!,
take: Int
}
input FilterDescriptorType {
field: String = null,
value: Any = null,
logic: LogicalOperator = null,
operator: FilterOperator = null,
filters: [FilterDescriptorType] = null
}
enum SortDirection {
DESC,
ASC
}
enum FilterOperator {
EQ
NEQ
STARTSWITH
CONTAINS
DOESNOTCONTAIN
ENDSWITH
GT
GTE
LT
LTE
ISNULL
IN
NOT_IN
}
enum LogicalOperator {
AND
OR
}
In GraphQL, an endpoint is the URL where you send your GraphQL requests to interact with the API. It's like the gateway to the GraphQL service, allowing you to perform queries, mutations, and subscriptions. The API endpoint for the Kryon public API is <PROTOCOL>://<FQDN>/public-api//
- There are two APIs available – the older Kryon public API and the newer Nintex public API. While the Kryon public API is the most used, it's important to note that only the Nintex public API continues to evolve with regular updates and enhancements. Be sure to refer to the relevant API documentation based on your requirements.
- Ensure that you use the correct endpoint for each API call to avoid errors. Some calls may be interchangeable between the two endpoints, but it is crucial to match the call with the appropriate endpoint for seamless execution.
Follow these steps to get an access token:
-
Create a POST token request using a tool like cURL, Postman, or a programming language (e.g., Python, JavaScript). For this example, we'll use Postman.
-
Enter the URL of the Kryon public API token endpoint in the request URL field using the format:
POST
<PROTOCOL>://<FQDN>/auth/realms/Kryon/protocol/openid-connect/token
Customize the URL based on your specific environment:
-
<PROTOCOL>: Replace this with the protocol used by the API. It could be either http or https, depending on the API's security.
-
<FQDN>: Replace this with the fully-qualified domain name of the server hosting the Kryon public API.
-
-
Open the Body tab.
-
Select x-www-form-urlencoded as the content type of the request body.
-
Enter the Key-Value pairs that represent parameters required by the authentication server:
-
client_id: Set to kryon-public-api.
-
grant_type: Set to password.
-
username: Set this to your actual username, which you get during user registration or that is provided by your system administrator.
-
password: Set this to your actual password, which is associated with the provided username.
Example:
-
-
Run the POST request to send the request to the token endpoint. This will differ depending on the tool (e.g., Postman) or programming language (e.g., cURL, Python, JavaScript) that you are using. After the request is sent successfully, the authentication server responds with a JSON object that includes the access token.
-
Copy the access token from the API response. It's usually found in a field named "access_token".
-
Save the access token for authenticating other requests to protected resources.
Follow these steps to create an AddQueue request:
-
Send a POST request using a tool like cURL, Postman, or a programming language (e.g., Python, JavaScript). For this example, we'll use Postman.
-
Enter the URL of the Kryon public API endpoint in the request URL field using the format:
<PROTOCOL>://<FQDN>/public-api/
.Customize the URL based on your specific environment:
-
<PROTOCOL>: Replace this with the protocol used by the API. It could be either http or https, depending on the API's security.
-
<FQDN>: Replace this with the fully-qualified domain name of the server hosting the Kryon public API.
Example:
If the protocol is HTTPS and the FQDN is "api.nintexexample.com," the URL could be:
Copyhttps://api.nintexexample.com/public-api/
-
-
Click the Authorization tab.
-
Set the Type to Bearer Token.
-
Paste the access token copied from the Authentication section into the Token field in the Authorization tab.
-
Add new headers in the Headers tab:
-
KEY: Content-Type, VALUE: application/json
-
KEY: kryon-client-id, VALUE: kryon-public-api
-
KEY: kryon-auth-provider, VALUE: aerobase
-
-
Open the Body tab.
-
Select GraphQL as the content type of the request body.
-
Enter the GraphQL query and variable in the Body tab.
-
Click Send.