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:

NameDescriptionData Type
placeId(Required) Unique place identifier associated with the site.
Int

Body:

NameDescriptionData 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

NameDescriptionData Type
IdUnique site identifier
Int
ModifiedOnIndicates 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

MessageDescription
401 UnauthorizedThis error is thrown when Authorization token is invalid or expired.
The place already has site. Try update siteThis error is thrown when trying to add a site to a place with existing site.
Place coords is outside of provided polygonThis 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 idThis error is thrown when the placeId or siteId is not associated with the account.