Sites API

List sites

List all sites for an account:

GET /sites

Response

Status: 200 OK
[
  {
    "name": "Widget Data Center",
    "created_at": "2016-03-14T03:09:52-06:00",
    "sourceID": null,
    "updated_at": "2016-03-14T03:09:52-06:00",
    "id": 13
  },
  {
    "name": "IT Training Facility",
    "created_at": "2016-03-14T09:10:17-06:00",
    "sourceID": null,
    "updated_at": "2014-01-18T11:29:02-06:00",
    "id": 29,
    "disabled": true
  },
  "..."
]

The response contains these fields by default. Filtering and pagination are available to reduce/limit the collection of sites.

States

The following states are available:

Collection Fields

By default the following fields will appear in collections of sites:

id sourceID name created_at updated_at

Obtain a different set of fields using the ?fields= parameter.

Sorting

By default a collection of sites is sorted ascending by name.

The following fields are accepted by the ?sort= parameter:

id sourceID name created_at updated_at

Get a single site

GET /sites/:id

Response

Status: 200 OK
{
  "picture_uri": null,
  "name": "Widget Data Center",
  "city": "Houston",
  "address": "1919 Briar Oaks Lane",
  "zip": "77027",
  "remarks": null,
  "created_at": "2016-03-14T03:09:52-06:00",
  "sourceID": null,
  "country": "US",
  "updated_at": "2016-03-14T03:09:52-06:00",
  "id": 13,
  "time_zone": "Central Time (US & Canada)",
  "source": null,
  "disabled": false,
  "state": "TX",
  "custom_data": null,
  "ui_extension": null
}

The response contains these fields.

Create a site

POST /sites

When creating a new site these fields are available.

Response

Status: 201 Created
{
  "address": "...",
  "...": "..."
}

The response contains all fields of the created site and is similar to the response in Get a single site

Update a site

PATCH /sites/:id

When updating an existing site these fields are available.

Response

Status: 200 OK
{
  "address": "...",
  "...": "..."
}

The response contains all fields of the updated site and is similar to the response in Get a single site

Fields

address
Readonly string (max 1024) — The address lines of the street address.
city
Readonly string (max 80) — The city name of the street address.
country
Readonly string (max 128) — The 2-letter country code of the street address.
created_at
Readonly datetime — The date and time at which the site was created.
custom_data
Optional hash — Custom data provided in JSON format by the UI Extension that is linked to the site.
disabled
Optional boolean, default: false — The Disabled box is checked when the site may no longer be related to other records.
id
Readonly integer — The unique ID of the site.
name
Required string (max 80) — The Name field is used to enter the name of the site or facility.
picture_uri
Readonly TODO — The hyperlink to the image file that was uploaded for the site.
remarks
Optional text (max 64KB) — The Remarks field is used to add any additional information about the site that might prove useful.
source
Optional string (max 30) - See source
sourceID
Optional string (max 128) - See source
state
Readonly string (max 30) — The state name of the street address.
time_zone
Optional string (max 50) — The Time zone field is used to select the time zone in which the site is located.
ui_extension
Readonly reference to UI Extension — The UI extension field indicates the UI extension that is applied to the site.
updated_at
Readonly datetime — The date and time of the last update of the site. If the site has no updates it contains the created_at value.
zip
Readonly string (max 20) — The zip code of the street address.