Skip to content

locationContact

Deprecated

This endpoint will stop working on 1 August 2027. Migrate to POST /v1/sites in the new API; the migration guide has the recommended order of work and the important model differences.

Legacy /rest/contact/locationContact created a Site and a Contact (plus the SiteContact link) in a single call. The new API needs three:

sequenceDiagram
    autonumber
    participant Client
    participant API as Oneserve API
    Client->>API: POST /v1/sites<br/>{name, postcode, ...}
    API-->>Client: {id: siteId}
    Client->>API: POST /v1/contacts<br/>{firstName, lastName, ...}
    API-->>Client: {id: contactId}
    Client->>API: PUT /v1/sites/{siteId}/contacts/{contactId}
    API-->>Client: 204 No Content

No atomic upsert: each step is independent. If a later call fails you'll need to compensate (delete the orphaned site/contact, or retry the link).

Open POST /v1/sites in the new API →

View legacy reference
/rest/contact/locationContact

POST
This API adds or updates a Site and Contact.
In terms of mandatory and non mandatory fields, the existing Location and Contact API's already specify these as they differ depending on whether a site or contact is being added or updated.
If the records are being added a SiteContact record will need to be created to map the contact to the site.
If the JSON string is missing the contact data the site should still be created as there will be instances where the contact is not known and sent so we don't want to create lots of dummy contacts just to push them through this API. However this should not work the other way around and the request should fail.
 
acceptable request representations:

  • application/json
 {  "locations": [ 
        {
            "clientRef": "ddhs",
            "locationRef": "abc123",
            "groupId": "23",
            "usageTypeId": "34",
            "regionId": "3",
            "typeId": "9",
            "name": "Allen Ave, 12",
            "address1": "12 Allen Ave",
            "address2": "Eastleigh",
            "address3": "Oxon",
            "address4": "",
            "postCode": "DF8 89H",
            "statusId": "2",
            "area": "North",
            "considerations": "cat",
            "deleted": "True",            "contacts" : [

                {
                    "contactRef": "ahah",
                    "salutation": "Mr",
                    "forename": "Arthur",
                    "surname": "Putey",
                    "contact1": "08789 998778",
                    "contact1Type": "2",
                    "contact2": "aputey@email.com",
                    "contact2Type": "3",
                    "contact3": "arthur64",
                    "contact3Type": "7",
                    "contact4": "01395 278878",
                    "contact4Type": "1",
                    "preferredContact": "1",
                    "address1": "7 Eve St",
                    "address2": "Siydenham",
                    "address3": "Oxon",
                    "address4": "",
                    "postCode": "OX7 7HG",
                    "notes": "some notes",
                    "considerations": "some considerations",                    "isPreferred":"true",                    "startDate":"12/12/2010",                    "endDate":"12/12/2099"
                }
            ]        }    ]
}

available response representations:
  • 200 - application/json

{
    "result" : "success or fail",
    "result_msg" : "error message"
}

See the Contact API matrix for the full list of endpoints in this category.