get
https://app.fracttal.com/api/wo_execution_times/
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_timesInput parameters
The information can be filtered with the following query_params. All are optional.
| Parameter | Type | Required | Description |
|---|---|---|---|
id_work_order_task | integer | Optional | Id of the task in the work order. Can be looked up here. (field id_work_orders_tasks) |
id_work_order | integer | Optional | Id of the work order. Can be looked up here. (field id_work_order) |
since | string | Optional | New. 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. |
until | string | Optional | New. End date of the filter range. ISO 8601 format, e.g. 2023-08-01T20:00:00-03. Only takes effect together with since. |
type_date | string | Optional | New. 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. |
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. |
Output parameters
Note: All dates returned by Fracttal web services are in UTC-0.
| Parameter | Type | Description |
|---|---|---|
id_work_order_task | integer | Task id within the WO |
initial_date | string | Start date of the task execution |
final_date | string | End date of the task execution |
id_wo_tasks_execution_types | integer | Id of the execution type assigned to the record. Returns null if no type was assigned. |
wo_tasks_execution_types_description | string | Description 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. |
note | string | Note on the execution record. Returns null if no note was entered. |
name | string | Name of the person who logged the time |
id_account | integer | Id of the account that logged the task execution |
id_personnel | integer | Id of the human resource (if the account is linked to a human resource) |
personnel_code | string | Code of the human resource (if the account is linked to a human resource) |
third_party_id | integer | Id of the third party (if the account is linked to a third party) |
third_party_code | string | Code of the third party (if the account is linked to a third party) |
third_party_contact_name | string | Contact name of the third party (if the account is linked to a third party) |
execution_events | array | Array of events for the execution block, ordered by id descending (most recent event first). See structure below. |
Structure of each event inexecution_events
Parameter Type Description idinteger Execution event ID action_typeinteger Action type: 0= PAUSED,1= IN_PROGRESSaction_type_descriptionstring Text description: "PAUSED"or"IN_PROGRESS"id_wo_tasks_execution_typesinteger ID of the execution type assigned to the event; null if not applicable. Preserved even if the type is deleted from the catalog. paused_reason_descriptionstring Description of the pause reason; null if not applicable or if the type was deleted from the catalog (resolved live, not a snapshot). initial_datestring Start date/time of the event (UTC-0) final_datestring End date/time of the event (UTC-0) notestring Event note; null if not entered duration_secondsinteger Duration of the event in seconds
Errors
| Code | Cause |
|---|---|
400 | type_date (or its alias property_date) with a value outside the allowed list. |
400 | since, until, id_work_order_task or id_work_order with a value that doesn't match the expected format. |
404 | id_work_order doesn't exist in the caller's company. |
Example
Response 200
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)
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)
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)
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
}