Query pending tasks

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_todo

Input parameters

The information can be filtered with the following query_params. All are optional.

ParameterTypeRequiredDescription
untilstringOptionalEnd date of the query. Format: YYYY-MM-DDTHH:MM:SS-UTC. Example: 2016-07-12T20:00:00-03. (Default: one month).
code_locationstringOptionalCode of the asset's location. Can be looked up here. (field code)
startintegerOptionalRecord number where the query will start. Default 0. All queries are limited to 100 records; use this parameter for pagination.
limitintegerOptionalNumber of records the request will show. Default 100.
sincestringOptionalStart date of the query. Format: YYYY-MM-DDTHH:MM:SS-UTC. Example: 2016-07-12T20:00:00-03.
include_out_of_servicebooleanOptionalNew. 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_service aliases

Also accepted as aliases: id_items_availability, out_of_service and asset_out_of_service — the first non-empty value received is used, in that priority order.

Output parameters

ParameterTypeDescription
id_taskintegerTask id
id_itemintegerAsset id
item_descriptionstringAsset description
codestringAsset code
group_task_descriptionstringTask plan
is_activebooleanWhether the asset is active
visible_to_allstringAsset visible to everyone
parent_descriptionstringAsset's location
date_maintenancestringCalculated date
trigger_descriptionstringEvent that triggered the task
delaystringDelay time
descriptionstringTask description
durationstringEstimated duration in seconds
tasks_types_main_descriptionstringTask type
priorities_descriptionstringTask priority
tasks_types_descriptionstringTask classification 1
tasks_types_2_descriptionstringTask classification 2
num_resourcesstringNumber of resources in the task
last_date_maintenancestringLast scheduled date
task_notestringTask note
requested_bystringRequested by (if the task was executed from a request)
id_requeststringRequest id (if the task was executed from a request)
event_datestringEvent date
cal_date_maintenancestringScheduled date
replay_counterintegerNumber of times the task has run
replay_counter_cyclesintegerNumber of executions in the cycle
num_iterationsintegerLast iteration executed
out_of_servicebooleanNew. 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_servicebooleanNew. Same value as out_of_service (same calculation, duplicated field).

Errors

CodeCause
400The 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

{
  "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)

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)

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
}
Response

Language
LoadingLoading…