Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
mountaindude
Partner Ambassador
Partner Ambassador

Using Sense API to get notification when scheduled task fails

I am looking for a way to hook into the Sense backend and attach a callback/event trigger, so I can get notified when for example certain reload tasks fail.

Looking at the API, there are a set of "Notification" endpoints, for example "Notification: Add change subscription".

Sounds very promising, but the docs are somewhat vague wrt what will trigger a notification. From what I understand, this API will trigger when conditions (add/update/delete) are met for certain properties of an entity (or several entities).

Or should I set the reload task as the entity, then subscribe to a changed event for that entity, and finally look at what the change consists of?

I think some trial and error is needed here, unless some API wiz can provide guidance...?

Thx

Göran

Please mark the post as a solution if it provided you with a solution to the topic at hand. Thanks!
1 Solution

Accepted Solutions
Anonymous
Not applicable

One way would be to subscribe to updates to ExecutionResult objects filtering on property status being FinishedFail, as below:

POST /qrs/notification?name=ExecutionResult&filter=status%20eq%20FinishedFail&changetype=Update

Note that the body in the request above should be a double quoted URL, e.g. "http://localhost:9876/notifyme". The API documentation incorrectly states that you will get a GUID back. Instead, you will get a change info object back looking something like this:


[{"id":"00000000-0000-0000-0000-000000000000","createdDate":"1753-01-01T00:00:00.000Z","modifiedDate":"1753-01-01T00:00:00.000Z","modifiedByUserName":"","changeType":2,"objectType":"ExecutionResult","objectID":"87c4d045-7841-4b55-8734-defd9a3f55f8","engineID":"","engineType":"","privileges":null,"schemaPath":"ExternalChangeInfo"}]

ObjectID refers to the ID of the ExecutionResult object. To find out more about the task execution and which task that failed, you will need to query the API for the ExecutionResult object. Then, use the ExecutionResult object's property taskID to fetch the task.


GET /qrs/executionresult/87c4d045-7841-4b55-8734-defd9a3f55f8
GET /qrs/reloadtask/65e4a7af-c5fe-49c9-a79e-b5959f2af36b

/Mattias

View solution in original post

3 Replies
Anonymous
Not applicable

One way would be to subscribe to updates to ExecutionResult objects filtering on property status being FinishedFail, as below:

POST /qrs/notification?name=ExecutionResult&filter=status%20eq%20FinishedFail&changetype=Update

Note that the body in the request above should be a double quoted URL, e.g. "http://localhost:9876/notifyme". The API documentation incorrectly states that you will get a GUID back. Instead, you will get a change info object back looking something like this:


[{"id":"00000000-0000-0000-0000-000000000000","createdDate":"1753-01-01T00:00:00.000Z","modifiedDate":"1753-01-01T00:00:00.000Z","modifiedByUserName":"","changeType":2,"objectType":"ExecutionResult","objectID":"87c4d045-7841-4b55-8734-defd9a3f55f8","engineID":"","engineType":"","privileges":null,"schemaPath":"ExternalChangeInfo"}]

ObjectID refers to the ID of the ExecutionResult object. To find out more about the task execution and which task that failed, you will need to query the API for the ExecutionResult object. Then, use the ExecutionResult object's property taskID to fetch the task.


GET /qrs/executionresult/87c4d045-7841-4b55-8734-defd9a3f55f8
GET /qrs/reloadtask/65e4a7af-c5fe-49c9-a79e-b5959f2af36b

/Mattias

pragya10
Partner - Contributor II
Partner - Contributor II

Hi,

Did you test this on Postman ?

soporte_derevo
Partner - Contributor
Partner - Contributor

can this use info for QlikView?