Query task execution times in WOs

Query the detailed information of a list of assets or a specific asset. This API allows you to query the detail of the times used for the execution of a task within a work order.

GET https://app.fracttal.com/api/wo_execution_times

Input parameters

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

ParameterTypeRequiredDescription
id_work_order_taskintegerOptionalId of the task in the work order. Can be looked up here. (field id_work_orders_tasks)
id_work_orderintegerOptionalId of the work order. Can be looked up here. (field id_work_order)
sincestringOptionalNew. Start date of the filter range. ISO 8601 format, e.g. 2023-08-01T20:00:00-03. If sent together with until but without type_date, filters by initial_date or final_date within the range.
untilstringOptionalNew. End date of the filter range. ISO 8601 format, e.g. 2023-08-01T20:00:00-03. Only takes effect together with since.
type_datestringOptionalNew. Date field the since/until filter applies to. Allowed values: creation_date, date_maintenance, cal_date_maintenance, initial_date, final_date, review_date, wo_final_date. Accepted alias: property_date. An unlisted value responds 400.
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.

Output parameters

Note: All dates returned by Fracttal web services are in UTC-0.

ParameterTypeDescription
id_work_order_taskintegerTask id within the WO
initial_datestringStart date of the task execution
final_datestringEnd date of the task execution
id_wo_tasks_execution_typesintegerId of the execution type assigned to the record. Returns null if no type was assigned.
wo_tasks_execution_types_descriptionstringDescription of the execution type. Returns null if no type was assigned, the company doesn't have time categorization enabled, or the type was deleted from the catalog.
notestringNote on the execution record. Returns null if no note was entered.
namestringName of the person who logged the time
id_accountintegerId of the account that logged the task execution
id_personnelintegerId of the human resource (if the account is linked to a human resource)
personnel_codestringCode of the human resource (if the account is linked to a human resource)
third_party_idintegerId of the third party (if the account is linked to a third party)
third_party_codestringCode of the third party (if the account is linked to a third party)
third_party_contact_namestringContact name of the third party (if the account is linked to a third party)
execution_eventsarrayArray of events for the execution block, ordered by id descending (most recent event first). See structure below.

Structure of each event in execution_events

ParameterTypeDescription
idintegerExecution event ID
action_typeintegerAction type: 0 = PAUSED, 1 = IN_PROGRESS
action_type_descriptionstringText description: "PAUSED" or "IN_PROGRESS"
id_wo_tasks_execution_typesintegerID of the execution type assigned to the event; null if not applicable. Preserved even if the type is deleted from the catalog.
paused_reason_descriptionstringDescription of the pause reason; null if not applicable or if the type was deleted from the catalog (resolved live, not a snapshot).
initial_datestringStart date/time of the event (UTC-0)
final_datestringEnd date/time of the event (UTC-0)
notestringEvent note; null if not entered
duration_secondsintegerDuration of the event in seconds

Errors

CodeCause
400type_date (or its alias property_date) with a value outside the allowed list.
400since, until, id_work_order_task or id_work_order with a value that doesn't match the expected format.
404id_work_order doesn't exist in the caller's company.

Example

Response 200

{
  "success": true,
  "message": "200",
  "data": [
    {
      "id": 8271217,
      "id_company": 1190,
      "id_work_order_task": 13951616,
      "initial_date": "2023-03-27T16:43:14.296123+00:00",
      "final_date": "2023-03-27T16:48:32.809057+00:00",
      "id_wo_tasks_execution_types": 3,
      "wo_tasks_execution_types_description": "Búsqueda de material",
      "note": "Nota del registro",
      "id_account": 3,
      "name": "JUAN PÉREZ",
      "id_personnel": 1539,
      "personnel_code": "RH-001",
      "third_party_id": null,
      "third_party_code": null,
      "third_party_contact_name": null,
      "execution_events": [
        {
          "id": 100203,
          "action_type": 1,
          "action_type_description": "IN_PROGRESS",
          "id_wo_tasks_execution_types": null,
          "paused_reason_description": null,
          "initial_date": "2023-03-27T16:46:30.000000+00:00",
          "final_date": "2023-03-27T16:48:32.809057+00:00",
          "note": null,
          "duration_seconds": 122
        },
        {
          "id": 100197,
          "action_type": 0,
          "action_type_description": "PAUSED",
          "id_wo_tasks_execution_types": 3,
          "paused_reason_description": "Búsqueda de material",
          "initial_date": "2023-03-27T16:45:00.000000+00:00",
          "final_date": "2023-03-27T16:46:30.000000+00:00",
          "note": "Falta insumos",
          "duration_seconds": 90
        }
      ]
    }
  ],
  "total": 1
}

Response — filtering by date range (200)

Request: GET /api/wo_execution_times/?id_work_order=34973667&since=2023-01-01T00:00:00-03&until=2023-03-31T23:59:59-03&type_date=initial_date

{
  "success": true,
  "message": "200",
  "data": [
    {
      "id": 8271217,
      "id_work_order_task": 13951616,
      "initial_date": "2023-03-27T16:43:14.296123+00:00",
      "final_date": "2023-03-27T16:48:32.809057+00:00",
      "execution_events": []
    }
  ],
  "total": 1
}

Response — error, invalid type_date (400)

Request: GET /api/wo_execution_times/?type_date=invalid_date

{
  "success": false,
  "message": "400",
  "data": [
    {
      "ERROR": "Validation failed. Invalid fields",
      "invalid_fields": [
        { "field": "type_date", "field_message": "type_date value is not correct", "field_validation": "CUSTOM" }
      ]
    }
  ],
  "total": 0
}

Response — error, non-existent id_work_order (404)

Request: GET /api/wo_execution_times/?id_work_order=999999999

{
  "success": false,
  "message": "404",
  "data": [
    { "ERROR": "Work order id 999999999 was not found in your company" }
  ],
  "total": 0
}
Response

Language
LoadingLoading…