With this API you can create a work order:

  • By creating an Unplanned task, whose information is downloaded from a task by event.

  • Or with the tasks are in pending tasks.

This web service is part of the APIS ADVANCED add-on.

Notes:

For the creation of TOs with the tasks that are in pending tasks, keep in mind:

For the creation of TOs by creating an unplanned task triggered by event, take into account:

EndPoint

https://app.fracttal.com/api/work_orders

POST method

Parameters Entry in the Body for the creation of a TO with tasks from Pending Tasks:

Parameter

Field type

Required

Description

type

Number

Yes

Type of ot creation, for this case it is 1

responsible_code

Text

Yes

Code of the human resource that will be responsible for the TO

account_code

Text

Yes

Code of the user account that will be registered as the TO creator.

tasks_todo

Array of json

Yes

Array with the information of the pending tasks.

Parameters Entry in the Body for the creation of a TO with an event-driven unscheduled task

Parameter

Field type

Requerido

Description

type

Número

Yes

Type of ot creation, for this case it is 3

item_code

Text

Yes

Code of the asset to which the TO will be performed.

responsible_code

Text

Yes

Code of the human resource that will be responsible for the TO

account_code

Text

Yes

Code of the user account that will be registered as the TO creator.

requested_by

Text

Yes

Requested by

id_task

Number

Yes

Id of the task from which the information will be obtained to create the TO

tasks_triggers_id

Number

Yes

Id of the event

id_group_task

Number

Yes

Id of the task list where the task from which the information will be obtained is located

task_descripcion

Text

Optional

Task description (Default is the name of the task from the id_task)

task_type_main

Text

Optional

Task type (Default is the id_task task)

task_type_description

Text

Optional

Task classification 1 (Default is the task from the id_task)

task_type_2_description

Text

Optional

Task classification 2 (Default is from the id_task task)

Note: Send the required fields and the parameters with the additional values to be inserted.

Output parameters

Parameter

Field type

Descripción

wo_folio

Text

ID of the TO that has just been created

id_status_work_order

Text

TO Status:

1: In process

2: Under review

3: Completed

4: Cancelled

responsible

Text

Name of the person responsible for the TO

responsible_code

Text

Code of the person in charge of the TO

date_created

Date

Date of creation of the TO

created_by

Text

Name of the user who is registered as the creator of the TO

Example tasks from pending tasks:

Request: (POST) https://app.fracttal.com/api/work_orders

Body

{ 
"type":1,
"responsible_code": "7809097-2",
"account_code": "7845123",
"tasks_todo":[
{
"tasks_todo_id":1600093
},
{
"tasks_todo_id":1087
}
]
}

Example Response:

{ 
"success": true,
"message": "200",
"data": {
"id": 1130348,
"id_company": 69,
"id_status_work_order": 1,
"wo_folio": "OT-1731",
"creation_date": "2021-07-27T14:43:38.330737+00:00",
"duration": 1200,
"id_assigned_user": null,
"initial_date": null,
"final_date": null,
"completed_percentage": 0,
"id_created_by": 40,
"created_by": "Alejandra Arango",
"signature": null,
"note": null,
"details_signature": null,
"id_validated_by": null,
"first_date_task": null,
"id_personnel_log": 10073,
"id_contacts_log": null,
"id_parent": null,
"is_offline": null,
"id_account_offline": null,
"code_created_by": "7845123",
"rating": null,
"enable_budget": false,
"id_work_orders_status_custom": null,
"review_date": null,
"id_accounts_log_validated_by": null,
"id_public": null,
"statistics": null,
"type_user": "HUMAN_RESOURCES",
"id_responsible": 60,
"id_account_responsible": null,
"description": "OT-1731"
}

Example creation of TOs from the creation of an unplanned task with information from an event:

Request: (POST) https://app.fracttal.com/api/work_orders

Body

{ 
"type": 3,
"item_code": "118",
"responsible_code": "32322",
"account_code": "25198772-2",
"requested_by": "Fracttal SPA",
"id_task": 86,
"task_descripcion": " New task generated by API ",
"tasks_triggers_id": 27,
"id_group_task": 1,
"task_type_main": "Correctiva",
"task_type_description": " MECHANICS ",
"task_type_2_description": " REQUIRES HEIGHT PERMIT "
}

Example Response:

{ 
"success": true,
"message": "200",
"data": {
"wo_folio": "OT-1694",
"id_status_work_order": 1,
"responsible": "FRACTTAL SPA",
"responsible_code": "32322",
"date_created": "2021-05-11T14:54:45.294203+00:00",
"created_by": "Laura Marcela Peña Jaramillo"
},
"total": 1
}

Did this answer your question?