EN
Español
English
Português
    Order Updates

    The related operation for the work order update is described.

    Details of the request:

    • Base URL: {host}/AFLSAPI/
    • URI: api/workorders/{id}
    • Type: PUT

    • Required headings:

    • Content-Type: application/json
    • X-Authorization: Bearer {Token}

    URL Description

    • {host}: It represents the domain of the environment in which the API is located.
    • AFLSAPI/: Fixed API prefix.
    • URI: Specific endpoint for the request.


    EXAMPLE URL:

    https://{host}/AFLSAPI/api/workorders/{id} 
    


    Parameters:

    Name Data type Obligatory Description
    addressContact String Yes Contact address
    addressContactInfo String No Contact Address Information
    assignmentType Integer No Assignment Type
    clientId Integer Yes Customer ID
    companyId Integer No Company ID
    contactEmail String No Contact email
    contactLatitude number - double Yes Address latitude contact
    contactLongitude number - double Yes Contact Direction Length
    contactName String Yes Contact Name
    contactPhone String No Contact telephone number
    creatorId Integer No Work Order Creator User ID
    Description String Yes Work Order Description
    endAddress String No Final address
    endAddressInfo String No Final Address Information
    endLatitude number - double No End Address Latitude
    endLongitude number - double No Final Address Length
    externalId String No Integration ID
    Id Integer Yes Id de la WorkOrder
    priority Integer Yes Priority Type: 0 - Normal, 1 - Emergency, 2 - Priority
    providerId Integer No Provider ID
    serviceId Integer Yes Service associated with the order
    specialistId Integer No Id of the attending specialist
    state Integer Yes Order Status - Value Only: 1
    subject String Yes Subject or title of the order
    subStateId Integer No Sub Estate
    ticketId String Yes Order Ticket
    attentionEndDate string - datetime No End of Care Date
    attentionStartDate string - datetime No Start of Care Date
    tentativeAttentionEndDate string - datetime No Tentative End of Care Date
    tentativeAttentionStartDate string - datetime No Date of Attention Tentative
    tentativeTravelStartDate string - datetime No Travel Start Date
    travelStartDate string - datetime No Travel Start Date
    additionalFields Array No List additional fields
    attachments Array No List of attachments
    Products Array No List products for service
    workTasks Array No Work order task list

    Body of the petition:

    The request consists of a JSON object. Example:

    {
        "addressContact": "Calle 39B, Teusaquillo, 11311 Teusaquillo, Distrito Capital, Colombia",
        "addressContactInfo": "",
        "clientId": 24,
        "companyId": null,
        "contactEmail": "prueba@pruebas.com",
        "contactLatitude": 4.629124230469785,
        "contactLongitude": -74.0730822280432,
        "contactName": "Cración de Ordenes con campos adicionales",
        "contactPhone": null,
        "description": "Cración de Ordenes con campos adicionales API WORKORDER",
        "endAddress": "",
        "endAddressInfo": "",
        "endLatitude": 0,
        "endLongitude": 0,
        "externalId": "",
        "id": 60,
        "priority": 0,
        "serviceId": 36,
        "specialistId": 886,
        "state": 1,
        "subject": "Cración de Ordenes con campos adicionales",
        "subStateId": 1,
        "ticketId": "60",
        "attentionEndDate": "",
        "attentionStartDate": "",
        "tentativeAttentionEndDate": "2026-07-10T21:28:26.517+00:00",
        "tentativeAttentionStartDate": "2026-07-10T20:28:26.517+00:00",
        "tentativeTravelStartDate": "2026-07-10T20:07:26.517+00:00",
        "travelStartDate": "",
        "additionalFields": [
            {
                "id": 24,
                "value": "3"
            },
            {
                "id": 24,
                "value": "Esta son unas pruebas para campo adicional tipo parrafo"
            }
        ],
        "products": [
            {
                "cost": 0,
                "description": "",
                "id": 0,
                "isActive": true,
                "name": "",
                "productId": 4,
                "quantity": 1,
                "serialNum": null,
                "sku": "",
                "typeProduct": 0
            }
        ],
        "workTasks": null
    }
    

    Answer:

    As an answer, a JSON object is obtained, with the following information:

     {
        "addressContact": "Floresta Outlet, Carrera 69, Santa Rosa, 11121 Suba, Distrito Capital, Colombia",
        "addressContactInfo": "Piso 7",
        "assignmentType": 0,
        "clientId": 213,
        "companyId": null,
        "contactEmail": "prueba@pruebas.com",
        "contactLatitude": 4.6919158,
        "contactLongitude": -74.0745394,
        "contactName": "PRUEBAS CREACIÓN DE ORDENES DESDE LA API DE WORKORDERS",
        "contactPhone": "30122222222",
        "creatorId": 3,
        "description": "PRUEBAS CREACIÓN DE ORDENES DESDE LA API DE WORKORDERS",
        "endAddress": null,
        "endAddressInfo": "",
        "endLatitude": 0.0,
        "endLongitude": 0.0,
        "externalId": null,
        "id": 60,
        "priority": 1,
        "providerId": 2,
        "serviceId": 1,
        "specialistId": 886,
        "state": 1,
        "subject": "Pruebas de Creación de orden de Emergencia",
        "subStateId": 10,
        "ticketId": "60",
        "attentionEndDate": null,
        "attentionStartDate": null,
        "tentativeAttentionEndDate": "2026-07-10T21:28:26.517+00:00",
        "tentativeAttentionStartDate": "2026-07-10T20:28:26.517+00:00",
        "tentativeTravelStartDate": "2026-07-10T20:07:26.517+00:00",
        "travelStartDate": null,
        "additionalFields": [
            {
                "actions": null,
                "definitionId": 1,
                "description": null,
                "formatValidator": null,
                "helpMessage": "Campo orden simple",
                "id": 4,
                "itemId": 0,
                "keepHistory": false,
                "label": "Campo orden simple",
                "name": "ca-campo orden simple-1",
                "options": null,
                "order": 1,
                "permissions": [
                    {
                        "statusId": 7,
                        "name": "General",
                        "roles": [
                            {
                                "actions": {
                                    "edit": true,
                                    "required": false,
                                    "view": true
                                },
                                "id": 276,
                                "name": "AFLS_Dispatcher"
                            },
                            {
                                "actions": {
                                    "edit": true,
                                    "required": false,
                                    "view": true
                                },
                                "id": 278,
                                "name": "AFLS_Monitor"
                            }
                        ]
                    }
                ],
                "state": null,
                "status": true,
                "typeId": 1,
                "value": null
            }
        ],
        "attachments": [
            {
                "createDate": "2024-03-19T22:24:37.607+00:00",
                "description": null,
                "fileExtension": "pdf",
                "filePath": null,
                "fileSize": "182848",
                "id": 6,
                "realFileName": "PRUEBA",
                "serveFileName": null
            }
        ],
        "products": [
            {
                "cost": 10000.00,
                "description": "Cable",
                "id": 11,
                "isActive": true,
                "name": "Cable",
                "productId": 1,
                "quantity": 2,
                "serialNum": null,
                "sku": "001",
                "typeProduct": 0
            }
        ],
        "workTasks": null
    }
    

    Error messages:

    Code HTTP status Error Message
    400 BadRequest Id is mandatory.
    400 BadRequest Id not found.
    400 BadRequest ServiceId cannot change.
    400 BadRequest ClientId cannot change.
    400 BadRequest Priority cannot change.
    400 BadRequest SubState cannot change.
    400 BadRequest External ID exists in another work order
    400 BadRequest Additional fields not configured.