FieldEx Developer
developer notes

Patch a Site

The PATCH operation on the Site API allows you to make partial updates to site details. This includes modifications to attributes such as site number, name, location, customer association, and type.

Method API Endpoint
PATCH {{endpoint}}/api/ext/sites

Headers

Key Value
Content-Type application/json
Authorization Bearer {{token}}

Example Body

{
    "createdBy": "arfan2@custella.com",
    "createdDate": "2023-01-26T05:01:32Z",
    "lastModifiedBy": "arfan2@custella.com",
    "lastModifiedDate": "2023-01-26T05:01:32Z",
    "siteNumber": "test",
    "siteName": "Test",
    "referenceId": "false",
    "externalId": "1",
    "street": "xxxxx",
    "state": "xxxxxx",
    "city": null,
    "postcode": null,
    "country": null,
    "lat": null,
    "lng": null,
    "contactPersonName": null,
    "designation": null,
    "phone1": null,
    "phone2": null,
    "website": null,
    "email": null,
    "fax": null,
    "description": null,
    "customer": {       
        "customerExternalId": "ARFA1"
    },
    "type": {     
        "code": "test"
    },
    "category": {        
        "code": "category1"
    },
    "subCategory": {
        "code": "SubCategory1"
    },
    "area": {     
        "code": "Area_2"
    },
    "geoFence": {   
        "geoFenceName": "worksiteTest11"
    },
    "serviceZone": {     
        "code": "Singapore"
    },
    "userGroup": {
        "name": "asaS"
    },
    "siteStatus": {     
        "name": "sitestatus1"
    }
}

Example Response

// 500 Response Code 

{
    "type": "http://www.jhipster.tech/problem/problem-with-message",
    "title": "Internal Server Error",
    "status": 500,
    "detail": "Site not found with site external Id : 1",
    "path": "/custella-0.0.1-SNAPSHOT/api/ext/sites",
    "message": "error.http.500"
}