FieldEx Developer
developer notes

Update Site

Update site details using the SiteUpdate API. Provide information such as site number, name, external ID, address, customer, type, category, and other parameters.

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

Headers

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

Example Request

{
    "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"
}