get
https://app.fracttal.com/api/tasks_todo/
This API queries the list of pending tasks. It can be filtered by scheduled date; by default it shows pending tasks within a 1 month range.
GET https://app.fracttal.com/api/tasks_todoInput parameters
The information can be filtered with the following query_params. All are optional.
| Parameter | Type | Required | Description |
|---|---|---|---|
until | string | Optional | End date of the query. Format: YYYY-MM-DDTHH:MM:SS-UTC. Example: 2016-07-12T20:00:00-03. (Default: one month). |
code_location | string | Optional | Code of the asset's location. Can be looked up here. (field code) |
start | integer | Optional | Record number where the query will start. Default 0. All queries are limited to 100 records; use this parameter for pagination. |
limit | integer | Optional | Number of records the request will show. Default 100. |
since | string | Optional | Start date of the query. Format: YYYY-MM-DDTHH:MM:SS-UTC. Example: 2016-07-12T20:00:00-03. |
include_out_of_service | boolean | Optional | New. Filters tasks by whether the associated asset has an active "Out of Service" period (recorded in Asset Availability). true: only tasks with an active period. false: only tasks without an active period. If omitted or sent empty, returns all tasks without filtering by this criterion. Accepts true/false/1/0 (case-insensitive). |
include_out_of_servicealiasesAlso accepted as aliases:
id_items_availability,out_of_serviceandasset_out_of_service— the first non-empty value received is used, in that priority order.
Output parameters
| Parameter | Type | Description |
|---|---|---|
id_task | integer | Task id |
id_item | integer | Asset id |
item_description | string | Asset description |
code | string | Asset code |
group_task_description | string | Task plan |
is_active | boolean | Whether the asset is active |
visible_to_all | string | Asset visible to everyone |
parent_description | string | Asset's location |
date_maintenance | string | Calculated date |
trigger_description | string | Event that triggered the task |
delay | string | Delay time |
description | string | Task description |
duration | string | Estimated duration in seconds |
tasks_types_main_description | string | Task type |
priorities_description | string | Task priority |
tasks_types_description | string | Task classification 1 |
tasks_types_2_description | string | Task classification 2 |
num_resources | string | Number of resources in the task |
last_date_maintenance | string | Last scheduled date |
task_note | string | Task note |
requested_by | string | Requested by (if the task was executed from a request) |
id_request | string | Request id (if the task was executed from a request) |
event_date | string | Event date |
cal_date_maintenance | string | Scheduled date |
replay_counter | integer | Number of times the task has run |
replay_counter_cycles | integer | Number of executions in the cycle |
num_iterations | integer | Last iteration executed |
out_of_service | boolean | New. Whether the task's asset has an active "Out of Service" period at query time (no end date, or a future end date). Always returned, whether or not the filter is sent. |
asset_out_of_service | boolean | New. Same value as out_of_service (same calculation, duplicated field). |
Errors
| Code | Cause |
|---|---|
400 | The filter parameter (include_out_of_service or any of its aliases) received a non-boolean value. Real message: Parameter id_items_availability (or out_of_service, include_out_of_service, asset_out_of_service) must be a boolean (true, false, 1 or 0). Received: "<value_sent>" |
Example
Response 200
200{
"success": true,
"message": "200",
"data": [
{
"id": 1163,
"id_task": 986,
"id_item": 49210,
"item_description": "MAQUINA 1 { AMCO-01 }",
"code": "AMCO-01",
"group_task_description": "Mantenimiento Línea de Producción",
"is_active": true,
"visible_to_all": false,
"parent_description": "// AMCO/ ",
"date_maintenance": "2021-08-26T05:00:00+00:00",
"trigger_description": "DATE$EVERY$5$MONTHS",
"delay": 77,
"description": "Manto vehículo",
"duration": 600,
"tasks_types_main_description": "Mantenimiento",
"num_resources": 0,
"last_date_maintenance": "2021-03-26T05:00:00+00:00",
"cal_date_maintenance": "2021-08-26T05:00:00+00:00",
"replay_counter": 0,
"out_of_service": false,
"asset_out_of_service": false
}
],
"total": 1
}Response — filtering by out-of-service assets (200)
200)Request: GET /api/tasks_todo/?include_out_of_service=true
{
"success": true,
"message": "200",
"data": [
{
"id": 1163,
"id_task": 986,
"id_item": 49210,
"code": "AMCO-01",
"out_of_service": true,
"asset_out_of_service": true
}
],
"total": 1
}Response — error, non-boolean value (400)
400)Request: GET /api/tasks_todo/?include_out_of_service=maybe
{
"success": false,
"message": "400",
"data": [
{ "ERROR": "Parameter id_items_availability (or out_of_service, include_out_of_service, asset_out_of_service) must be a boolean (true, false, 1 or 0). Received: \"maybe\"" }
],
"total": 0
}