getTasks for specific routes using Alumio API

Hi Alumio Team,

Good day! We want to link the errored task from Alumio to our system so we can check the failed tasks for specific routes.

I checked the API documentation and it seems that this is not possible at the moment but not sure if you have a workaround for this. Here’s what we want to do:

We want to get the tasks for specific routes through API however, there are only 2 endpoints available on your API docs.

-getTasks - get all the task but this will apply to all routes.
-getTask - get the task using entry identifier

There is a query parameter “filter” for “getTasks” endpoint but not sure how to use this and if we can filter via routes. Can you please advise?

Currently, I’m trying to connect and test it via postman. Thanks!

Hi Farley,

We are happy to welcome you at the Alumio forum. Thank you for posting your question here.

The getTasks endpoint is the correct task for your case. The filter query parameter should be formatted in JSON. Below are the available parameters for the filter query parameter.

  • limit (limit the number of matched entities, for example 20)
  • skip (skip a number of entity, for example 0)
  • where (add conditions)
    - status (filter by status, for example {"inq": ["failed"]})
    - route (filter by route, for example {"inq": ["identifier-of-the-route"]})
    - createdAt (filter by creation date, for example {"gte": "2023-08-01T00:00:00.000Z"})
    - updatedAt (filter by modifying date, for example {"gte": "2023-08-01T00:00:00.000Z"})
    - identifier (filter by identifier), for example 01H8KCRD1XDQAP8X05X2ET27R1)
    - entityIdentifier (filter by entity identifier, for example SKU001)
  • order(apply ordering to the result, for example "createdAt desc").

In your case, you should use the below value for the filter query parameter.

{
    "where": {
        "status": {
            "inq": [
                "failed"
            ]
        },
        "route": {
            "inq": [
                "identifier-of-the-route"
            ]
        }
    }
}

Since it has to be in JSON format, then it has to be URL-encoded. The final URL of the request is below.

/api/v1/tasks?filter=%7B%22where%22%3A%7B%22status%22%3A%7B%22inq%22%3A%5B%22failed%22%5D%7D%2C%22route%22%3A%7B%22inq%22%3A%5B%22identifier-of-the-route%22%5D%7D%7D%7D

Please give it a try and let us know if you find any problems.