API for queues
Access and control queue-related functions through the GraphQL API using the Kryon endpoint. These APIs allow you to interact with queues, enabling operations such as retrieving queue information, accessing queue items, and performing actions on queue items.
Before you begin:
-
Learn the fundamentals of GraphQL, the query language used to request and manage data through the Kryon public API.
-
Understand how to create effective queries and mutations to make requests and interact with the API.
-
Learn how to get and authenticate an access token.
-
Discover and understand the available endpoints.
Schema overview
The GraphQL API schema is a blueprint outlining the structure and functionality of the public APIs. The schema provides a clear overview of available data types, queries, and mutations, offering a foundation for understanding how to interact with the APIs effectively.
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.

type Queue {
id: ID!
name: String!
tenantId: ID!
createdAt: DateTime!
isDeleted: Boolean
deletedAt: String
createdBy: String!
}
input GetQueueInput {
queueId: ID!
tenantId: ID
}
input GetQueuesInput {
tenantId: ID
filters: GetQueuesFilters
}
input AddQueueInput {
tenantId: ID
name: String!
}
input UpdateQueueInput {
queueId: ID!
tenantId: ID
name: String
}
input GetQueuesFilters {
name: StringFilter
createdBy: StringFilter
createdAt: DateTimeFilter
}
extend type Mutation {
addQueue(queue: AddQueueInput!): Queue
updateQueue(queue: UpdateQueueInput!): Queue
deleteQueue(id: ID!): Queue
addTask(task: AddTaskInput!): Task
}
extend type Query {
getQueue(queue: GetQueueInput!): Queue
getQueues(queues: GetQueuesInput!): [Queue]
}
extend type Mutation {
addQueue(queue: AddQueueInput): Queue
updateQueue(queue: UpdateQueueInput): Queue
}
API requests
The following API requests provide the ability to manage queues using the Kryon endpoint:

QUERY
query($queueInput: GetQueueInput!) {
getQueue(queue: $queueInput) {
id
name
tenantId
createdAt
isDeleted
deletedAt
createdBy
}
}

QUERY
query (queues: GetQueuesInput!){
getQueues(queues: $queues) {
id
name
tenantId
createdAt
isDeleted
deletedAt
createdBy
}
}
GRAPHQL VARIABLES
{
"tenantId": "1",
"queryInput" : {
"filter": {
"field": 'name',
"value": 'EliTest',
"operator": CONTAINS
},
"sort": [{
"field": "id",
"dir": ASC
}]
}
}
RESPONSE
{
"data": {
"getQueues": [
{
"id": "b7575c5f-9c99-4e3f-b5fa-f682c3044446",
"name": "EliTest",
"tenantId": "1",
"createdAt": "2021-12-21T16:00:52.810Z",
"isDeleted": false,
"deletedAt": null,
"createdBy": "testuser"
},
{
"id": "983f2fed-a324-447f-9525-bba89400b823",
"name": "EliTest1",
"tenantId": "1",
"createdAt": "2021-12-22T06:15:30.785Z",
"isDeleted": false,
"deletedAt": null,
"createdBy": "testuser"
}
]
}
}

QUERY
mutation ($queue: AddQueueInput){
addQueue: addQueue(queue: $queue) {
id
name
tenantId
createdAt
isDeleted
deletedAt
createdBy
}
}
RESPONSE
{
"data": {
"addQueue": {
"id": "1c86450b-9821-42a6-bc12-523191ca4fe6",
"name": "EliTest",
"tenantId": "1",
"createdAt": "2021-12-26T13:04:52.225Z",
"isDeleted": false,
"deletedAt": null,
"createdBy": "testuser"
}
}
}

QUERY
mutation ($updateQueueInput: UpdateQueueInput!) {
updateQueue(queue: $updateQueueInput) {
id
name
tenantId
createdAt
isDeleted
deletedAt
createdBy
}
}
GRAPHQL VARIABLES
{
queueId: "c764d59a-8f04-4647-be50-694f075ee477",
name: "publicQueue3",
tenantId: "1"
}
RESPONSE
{
"data": {
"updateQueue": {
"id": "c764d59a-8f04-4647-be50-694f075ee477",
"name": "publicQueue3",
"tenantId": "1",
"createdAt": "2021-12-22T10:45:00.697Z",
"isDeleted": false,
"deletedAt": null,
"createdBy": "testuser"
}
}
}