FieldEx Developer
developer notes

Create Site

Create a new site using the SiteCreate API. Provide details such as site number, name, external ID, address, customer, type, category, and other parameters.

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

Headers

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

Example Request

{
    "siteNumber": "test",
    "siteName": "Test",
    "referenceId": "false",
    "externalId": "1",
    "street": "abcd",
    "state": "pqrs",
    "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": "jj"
    },
    "type": {
        "code": "fd"
    },
    "category": {
        "code": "fd"
    },
    "subCategory": {
        "code": "fd"
    },
    "area": {
        "code": "fd"
    },
    "geoFence": {
        "geoFenceName": "fd"
    },
    "serviceZone": {
        "code": "fd"
    },
    "userGroup": {
        "name": "fd"
    },
    "siteStatus": {
        "name": "fd"
    },
    "projects": []
}

Example Response

// 400 Response Code

{
    "entityName": "Customer",
    "errorKey": "id null",
    "type": "http://www.jhipster.tech/problem/problem-with-message",
    "title": "Invalid Customer External Id",
    "status": "400",
    "message": "error.id null",
    "params": "Customer"
}