FieldEx Developer
developer notes

Get All Sites By Customer

Retrieve a list of sites filtered by customer using the SiteGetAllByCustomer API. This API supports pagination with parameters such as page, perPage, and startFrom.

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

Headers

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

Filter Fields

Parameter Type Example Length Required Description
page Number 0 true Specifies the page number
perPage Number 25 true Specifies the number of records per page
startFrom Number 0 true Specifies the start point of the column being sorted
columnName String id true Specifies the name of the column being sorted
sortOrder String desc/asc true Specifies the order in which the column is being sorted
search String a true Specifies the search query
typeId Number 1 false Type ID for filtering
serviceZoneId Number 2 false Service Zone ID for filtering
categoryId Number 1 false Category ID for filtering
projectId Number 1 false Project ID for filtering
geofenceId Number 1 false Geofence ID for filtering
customerId Number 1 false Customer ID for filtering
origin String project false Origin information for filtering

API Query Example

Method API Call
GET api/ext/sites?page=1&perPage=10&startFrom=0&columnName=id&sortOrder=desc&search=a&typeId=1&serviceZoneId=1&categoryId=1&projectId=7&geofenceId=1&customerId=1&origin=project

Example Response

// 200 Response Code
{
    "total": "1",
    "count": "10",
    "data": [
        {
            "id": "6578",
            "siteNumber": "ST-006578",
            "siteName": "Ladang Batu Pahat",
            "active": "true",
            "customer": {
                "id": "80759",
                "name": "SOU 2",
                "email": "null",
                "billingCity": "null",
                "billingCountry": "null",
                "billingPostcode": "null",
                "billingState": "null",
                "billingStreet": "null",
                "shippingCity": "null",
                "shippingCountry": "null",
                "shippingPostcode": "null",
                "shippingState": "null",
                "shippingStreet": "null",
                "billingLatitude": "null",
                "billingLongitude": "null",
                "phone": "null",
                "geoFence": "null",
                "systemUsed": "null",
                "isDeleted": "N",
                "customerSfExternalId": "null",
                "customerExternalId": "null",
                "shippingLatitude": "null",
                "shippingLongitude": "null",
                "serviceZone": "null",
                "categoryType": "null",
                "contactPersonName": "null",
                "customerReferenceNo": "null"
            },
            "geoFence": "null",
            "serviceZone": "null",
            "siteStatus": "null"
        }
    ],
    "recordsTotal": "1",
    "recordsFiltered": "1",
    "status": "HAS_DATA"
}