Fracttal →

Create a work order

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: 1.

  1. For the creation of WOs with the tasks that are in pending tasks, please note: To obtain the IDs of the pending tasks that you want to take to WO, you must consult the API Consult pending tasks.

  2. For the creation of WOs by creating an unplanned task triggered by event, take into account: The event from which the data is brought, cannot have associated resources. To obtain the information related to the trigger and the task, it is necessary to consult the web service Consult detailed information of task plans.

Input parameters for the creation of a WO with tasks from Pending Tasks.

ParameterTypeRequiredDescription
typeNumberYesType of WO creation, for this case it is 1.
responsible_codeTextOptional if third party information is sentCode of the human resource who will be responsible for the WO.
third_party_codeTextIt is optional if human resource information is sent.Code of the third party where the contact who will be responsible for the WO is located.
third_party_contactTextIt is optional if human resources information is sent.Name of the contact person who will be responsible for the wO
account_codeTextYesCode of the user account that will be registered as the creator of the wO
tasks_todoArray de json YesArray with the information of the pending tasks.

Each json, must contain the parameter tasks_todo_id that corresponds to the id of the task in pending tasks.

Parameters Input for the creation of a WO with an event-driven unscheduled task.

ParameterTypeRequiredDescription
type NumberYesType of ot creation, for this case it is 3.
item_code TextYesCode of the asset to which the WO is to be performed.
responsible_code TextOptional if third party information is sentCode of the human resource who will be responsible for the WO.
third_party_code TextIt is optional if human resource information is sent.Code of the third party where the contact who will be responsible for the WO is located.
third_party_contact TextIt is optional if human resource information is sent.Name of the contact person who will be responsible for the WO.
account_code *TextoYesCode of the user account to be registered as the creator of the WO.
requested_by TextYesRequested by
id_task NumberYesId of the task from which the information to create the WO will be obtained.
tasks_triggers_id NumberYesEvent Id.
id_group_task NumberYesId of the task list where the task from which the information will be obtained is located.
task_descripcion TextOptionalTask description (Default is the task name of the id_task).
task_type_main TextOptionalTask type (Default is id_task task).
task_type_description TextOptionalTask Rank 1 (Default is from the id_task task).
task_type_2_description TextOptionalTask classification 2 (Default is from the id_task task).
date_maintenanceTextOptionalDate of programming of the WO. Formato: ‘YYYY-MM-DDTHH:MM:SS-UTC’ Ejemplo:’2016-07-12T20:00:00-03′.

Output parameters

ParameterTypeDescription
wo_folio TextId of the WO just created.
id_status_work_order TextWO Status:

1: In process 2: Under review 3: Finalized 4: Cancelled.
responsible TextName of the person responsible for the WO.
responsible_code TextCode of the person responsible for the WO.
date_created DateDate of creation of the WO.
created_by TextName of the user who is listed as the creator of the WO.

Example:

Tasks from pending tasks: **

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

{
    "type":1,
    "responsible_code": "7809097-2",
    "account_code": "7845123",   
    "tasks_todo":[
        {
            "tasks_todo_id":1600093
        },
        {
            "tasks_todo_id":1087
        }
    ]
}
{
    "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"
}

Creation of TOs from the creation of an unscheduled task with information from an event:** **

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

{
    "type": 3,
    "item_code": "118",
    "responsible_code": "32322",
    "account_code": "25198772-2",
    "requested_by": "Fracttal SPA",
    "id_task": 86,
    "task_descripcion": "Nueva tarea generada por API",
    "tasks_triggers_id": 27,
    "id_group_task": 1,
    "task_type_main": "Correctiva",
    "task_type_description": "MECÁNICA",
    "task_type_2_description": "REQUIERE PERMISO ALTURA"
}
{
    "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
}

Test It

Language