Skip to main content

Technical terms of the Sop

This API allows you to create and update service procedures. It supports creating a new service procedure  and updating an existing one. The API is designed to handle multiple steps in the service procedure creation and update process.

Base URL

https://api-wx-staging.bynry.com/api/wx/service-procedure/


Endpoints

1. Create a Service Procedure

Create a new service procedure.

HTTP Request

Copy

POST /api/wx/service-procedure/

Headers

Request Body

json

{

    "name": "LeakageIsssues",

    "short_name": "LK",

    "sop_association_type": 2,

    "description": "Damage",

    "utility_services": [

        "Hot Water"

    ],

    "sop_type": "Residential#1",

    "sop_subtype": "Residential#1_Plumbing Issue#1",

    "rate": 230,

    "estimated_other_cost": 1230,

    "tax": "10#1",

    "staff_required": 3450,

    "rules": [

        47

    ],

    "asset_type": "Equipment#1_Compressors#1",

    "action_type": 1,

    "operation_type": 0,

    "remote_utility_id": 698

}

Response

  • Success (201 Created)

{

    "result": {

        "id": 267,

        "name": "LeakageIsssues",

        "short_name": "LK",

        "sop_association_type": 2,

        "description": "Damage",

        "utility_services": [

            "Hot Water"

        ],

        "sop_type": "Residential#1",

        "sop_subtype": "Residential#1_Plumbing Issue#1",

        "rate": 230,

        "estimated_other_cost": 1230,

        "tax": "10#1",

        "staff_required": 3450,

        "rules": [

            47

        ],

        "asset_type": "Equipment#1_Compressors#1",

        "action_type": 1,

        "operation_type": 0,

        "remote_utility_id": 698

    }

}

  • Error (400 Bad Request)

json

Copy

{

    "message": "Short name already exists."

}


2. Update a Service Procedure

Update an existing service procedure. This endpoint is used in multiple steps to update tasks, materials, readings, and documents.

HTTP Request

PATCH /api/wx/service-procedure/{sop_id}/

Request Body

The request body varies depending on the step being updated:

  1. Step 2: Update Tasks

json

{

    "task": [

        {

            "name": "Washing",

            "time": "12",

            "downtime": "12",

            "skill_id": [52],

            "is_photo_req": "No"

        },

        {

            "name": "Repair",

            "time": "12",

            "downtime": "12",

            "skill_id": [52],

            "is_photo_req": "No"

        }

    ],

    "task_time_count": 24,

    "total_downtime": 24,

    "remote_utility_id": 698

}

  1. Step 3: Update Materials

{

    "material": [

        {

            "name": "Wire",

            "size": "45",

            "quantity_required": "12",

            "cost": "13"

        }

    ],

    "material_cost_count": 156,

    "remote_utility_id": 698

}

  1. Step 4: Update Readings

{

    "readings": [

        {

            "name": "Safety_Brass",

            "unit": "12",

            "minimum": "3",

            "maximum": "2",

            "is_photo_req": "No",

            "key": "",

            "default": ""

        }

    ],

    "remote_utility_id": 698

}

  1. Step 5: Update Documents and Status

{

    "remote_utility_id": 698,

    "documents": [

        {

            "type": 0,

            "description": "ok",

            "link": null,

            "file": null

        }

    ],

    "status": 0

}

Response

  • Success (200 OK)

{

    "result": {

        "id": 267,

        "name": "LeakageIsssues",

        "short_name": "LK",

        "sop_association_type": 2,

        "description": "Damage",

        "utility_services": [

            "Hot Water"

        ],

        "sop_type": "Residential#1",

        "sop_subtype": "Residential#1_Plumbing Issue#1",

        "rate": 230,

        "estimated_other_cost": 1230,

        "tax": "10#1",

        "staff_required": 3450,

        "rules": [

            47

        ],

        "asset_type": "Equipment#1_Compressors#1",

        "action_type": 1,

        "operation_type": 0,

        "remote_utility_id": 698

    }

}