With this API you finalize a task within a WO. With this web service you can set the start and end date of the task, the failure information and/or if the asset was out of service.
This API is part of the ADVANCED APIS add-on.
EndPoint
https://app.fracttal.com/api/work_orders_tasks/
PUT Method
Parameters Input in the Body
Parameter | Field type | Required | Description |
id_work_order_task | Number | Yes | Task code within the WO |
initial_date | Text | Yes | Task start date |
final_date | Text | Yes | Task end date |
real_duration | Number | Yes | Time in seconds of the actual duration of the task |
is_done | Boolean | Yes | True: if the task is done |
code_account | Text | Yes | False: if the task is not completed |
asset_failure | Boolean | Optional | Inhouse Personnel code |
failure_type | Text | Optional | Value indicating whether the asset failed. False by default |
failure_cause | Text | Optional | Description of the failure |
failure_detection_method | Text | Optional | Description of the cause of the failure |
id_failure_severity | Number | Optional | Failure Severity Id 1: Very Low 2: Low 3: Medium 4: High 5: Very High |
id_damage_type | Number | Optional | Type of damage caused: 1: None 2: Damage to the environment 3: Damage to locations 4: Injury to inhouse personnel 5: Injury to third parties 6: Other |
asset_out_of_service | Boolean | Optional | value to indicate whether the task has an associated out-of-service. False by default |
date_asset_out_of_service | Date | Optional | Out-of-service start date |
Send the required fields and the parameters with the additional values to be inserted.
Output parameters
Parameter | Field type | Description |
id | Number | Task ID associated to the WO |
id_work_order | Number | ID of the WO |
id_item_log | Number | id of the log item associated to the task |
done | Boolean | Completion of the task |
last_date_maintenance | Date | Date of last maintenance |
cal_date_maintenance | Date | Calculated maintenance date |
date_maintenance | Date | Date of maintenance |
trigger_description | Date | Type of triggering event of the task |
duration | Number | Task duration in seconds |
initial_date | Date | Task start date |
final_date | Date | Task end date |
real_duration | Number | Actual task duration in seconds |
stop_assets_sec | Number | Asset stop time in seconds |
real_stop_assets_sec | Number | Actual asset downtime in seconds |
id_items_availability | Number | Id of the associated out-of-service |
Example:
Request: (PUT) https://app.fracttal.com/api/work_orders_tasks/
Body
{
"id_work_order_task":1776531,
"initial_date":"2020-06-29T20:00:00-05",
"final_date":"2020-06-30T08:00:00-05",
"real_duration":40000,
"is_done":"true",
"code_account":"7845123",
"asset_failure": "true",
"failure_type":" API FAILURE ",
"failure_cause":" CAUSE API FLAW ",
"failure_detection_method":" API FAILURE DETECTION METHOD ",
"id_failure_severity": 3,
"id_damage_type":1,
"asset_out_of_service": "true"
}
Example Response:
{
"success": true,
"message": "200",
"data": {
"id": 1776531,
"id_company": 69,
"id_work_order": 633665,
"id_item_log": 408,
"id_task_log": 463106,
"done": true,
"last_date_maintenance": "2020-11-18T20:59:38.578043+00:00",
"cal_date_maintenance": "2020-11-18T21:00:14.151688+00:00",
"date_maintenance": "2020-11-18T21:00:14.151688+00:00",
"trigger_description": "NO_SCHEDULE_TASK",
"duration": 600,
"id_task_trigger": null,
"initial_date": "2020-06-30T01:00:00+00:00",
"final_date": "2020-06-30T13:00:00+00:00",
"real_duration": 40000,
"stop_assets_sec": 0,
"real_stop_assets_sec": 0,
"id_items_availability": null
},
"total": 1
}