Create a Site

POST /sites

Create a site around a place.

Once you create a site via an API call, the site can be enhanced by adding entrances and exits using the ContentTools web tool.

Request

Authorization: bearer {token}

Parameters:

Name Description Data Type
placeId (Required) Unique place identifier associated with the site.
Int

Body:

Name Description Data Type
SiteName (Required) Name of the site
string
Polygon (Required) An array containing the latitude/longitude pairs that define the boundaries of the site. Must contain at least three coordinates.
Array of decimals

Response Body

Name Description Data Type
Id Unique site identifier
Int
ModifiedOn Indicates the time the site was created
DateTime

Sample Request

{
  "siteName": "Company Site",
  "Polygon": [
    [
      [-74.575495708167878, 40.382754195334741],
      [-74.574809062659838, 40.382137167831516],
      [-74.573006618202, 40.383436596653695]
    ]
  ]
}

Sample Response

{
  "data": [
    {
      "Id": 131926,
      "ModifiedOn": "2019-02-26T20:34:55.22+00:00"
    }
  ]
}

Error Codes

Message Description
401 Unauthorized This error is thrown when Authorization token is invalid or expired.
The place already has site. Try update site This error is thrown when trying to add a site to a place with existing site.
Place coords is outside of provided polygon This error is thrown when the Place is outside the site polygon
The supplied shape points do not result in a valid figure: 24404: Not valid because polygon ring (1) intersects itself or some other ring. The problem occurs in entry (2) in a geometry collection. This error is thrown when the coordinates do not create a closed polygon with non-intersecting sides.
Cannot find Item with supplied id This error is thrown when the placeId or siteId is not associated with the account.