SiteWhere REST APIs (2.0.rc2)

Download OpenAPI specification:Download

Operations that allow remote clients to interact with the core SiteWhere data model.

Authentication

JWT

Security scheme type: API Key
header parameter name: Authorization

area-types

Area Types

List area types matching criteria

Authorizations:
query Parameters
includeContainedAreaTypes
boolean
Default: false

Include contained area types

page
integer <int32>
Default: 1

Page number

pageSize
integer <int32>
Default: 100

Page size

Responses

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

get /areatypes
null//localhost:8080/sitewhere/api/areatypes

Create new area type

Authorizations:
Request Body schema: application/json
backgroundColor
string
borderColor
string
containedAreaTypeTokens
Array of string
description
string
foregroundColor
string
icon
string
imageUrl
string
metadata
object
name
string
token
string

Responses

200

OK

201

Created

401

Unauthorized

403

Forbidden

404

Not Found

post /areatypes
null//localhost:8080/sitewhere/api/areatypes

Request samples

application/json
Copy
Expand all Collapse all
{
  • "backgroundColor": "string",
  • "borderColor": "string",
  • "containedAreaTypeTokens":
    [
    ],
  • "description": "string",
  • "foregroundColor": "string",
  • "icon": "string",
  • "imageUrl": "string",
  • "metadata":
    {
    },
  • "name": "string",
  • "token": "string"
}

Get area type by token

Authorizations:
path Parameters
areaTypeToken
required
string

Token that identifies area type

Responses

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

get /areatypes/{areaTypeToken}
null//localhost:8080/sitewhere/api/areatypes/{areaTypeToken}

Update existing area type

Authorizations:
path Parameters
areaTypeToken
required
string

Token that identifies area type

Request Body schema: application/json
backgroundColor
string
borderColor
string
containedAreaTypeTokens
Array of string
description
string
foregroundColor
string
icon
string
imageUrl
string
metadata
object
name
string
token
string

Responses

200

OK

201

Created

401

Unauthorized

403

Forbidden

404

Not Found

put /areatypes/{areaTypeToken}
null//localhost:8080/sitewhere/api/areatypes/{areaTypeToken}

Request samples

application/json
Copy
Expand all Collapse all
{
  • "backgroundColor": "string",
  • "borderColor": "string",
  • "containedAreaTypeTokens":
    [
    ],
  • "description": "string",
  • "foregroundColor": "string",
  • "icon": "string",
  • "imageUrl": "string",
  • "metadata":
    {
    },
  • "name": "string",
  • "token": "string"
}

Delete area type by token

Authorizations:
path Parameters
areaTypeToken
required
string

Token that identifies area type

Responses

200

OK

204

No Content

401

Unauthorized

403

Forbidden

delete /areatypes/{areaTypeToken}
null//localhost:8080/sitewhere/api/areatypes/{areaTypeToken}

Get label for area type

Authorizations:
path Parameters
areaTypeToken
required
string

Token that identifies area type

generatorId
required
string

Generator id

Responses

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

get /areatypes/{areaTypeToken}/label/{generatorId}
null//localhost:8080/sitewhere/api/areatypes/{areaTypeToken}/label/{generatorId}

areas

Areas

List areas matching criteria

Authorizations:
query Parameters
areaTypeToken
string

Limit by area type token

includeAreaType
boolean
Default: false

Include area type

includeAssignments
boolean
Default: false

Include assignments

includeZones
boolean
Default: false

Include zones

page
integer <int32>
Default: 1

Page number

pageSize
integer <int32>
Default: 100

Page size

parentAreaToken
string

Limit by parent area token

rootOnly
boolean
Default: true

Limit to root elements

Responses

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

get /areas
null//localhost:8080/sitewhere/api/areas

Create new area

Authorizations:
Request Body schema: application/json
areaTypeToken
string
backgroundColor
string
borderColor
string
bounds
Array of object (Location)
description
string
foregroundColor
string
icon
string
imageUrl
string
metadata
object
name
string
parentAreaToken
string
token
string

Responses

200

OK

201

Created

401

Unauthorized

403

Forbidden

404

Not Found

post /areas
null//localhost:8080/sitewhere/api/areas

Request samples

application/json
Copy
Expand all Collapse all
{
  • "areaTypeToken": "string",
  • "backgroundColor": "string",
  • "borderColor": "string",
  • "bounds":
    [
    ],
  • "description": "string",
  • "foregroundColor": "string",
  • "icon": "string",
  • "imageUrl": "string",
  • "metadata":
    {
    },
  • "name": "string",
  • "parentAreaToken": "string",
  • "token": "string"
}

Get area by token

Authorizations:
path Parameters
areaToken
required
string

Token that identifies area

query Parameters
includeAreaType
boolean
Default: true

Include area type

includeParentArea
boolean
Default: true

Include parent area information

Responses

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

get /areas/{areaToken}
null//localhost:8080/sitewhere/api/areas/{areaToken}

Update existing area

Authorizations:
path Parameters
areaToken
required
string

Token that identifies area

Request Body schema: application/json
areaTypeToken
string
backgroundColor
string
borderColor
string
bounds
Array of object (Location)
description
string
foregroundColor
string
icon
string
imageUrl
string
metadata
object
name
string
parentAreaToken
string
token
string

Responses

200

OK

201

Created

401

Unauthorized

403

Forbidden

404

Not Found

put /areas/{areaToken}
null//localhost:8080/sitewhere/api/areas/{areaToken}

Request samples

application/json
Copy
Expand all Collapse all
{
  • "areaTypeToken": "string",
  • "backgroundColor": "string",
  • "borderColor": "string",
  • "bounds":
    [
    ],
  • "description": "string",
  • "foregroundColor": "string",
  • "icon": "string",
  • "imageUrl": "string",
  • "metadata":
    {
    },
  • "name": "string",
  • "parentAreaToken": "string",
  • "token": "string"
}

Delete area by token

Authorizations:
path Parameters
areaToken
required
string

Token that identifies area

Responses

200

OK

204

No Content

401

Unauthorized

403

Forbidden

delete /areas/{areaToken}
null//localhost:8080/sitewhere/api/areas/{areaToken}

List alerts for an area

Authorizations:
path Parameters
areaToken
required
string

Token that identifies area

query Parameters
endDate
string

End date

page
integer <int32>
Default: 1

Page number

pageSize
integer <int32>
Default: 100

Page size

startDate
string

Start date

Responses

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

get /areas/{areaToken}/alerts
null//localhost:8080/sitewhere/api/areas/{areaToken}/alerts

List device assignments for an area

Authorizations:
path Parameters
areaToken
required
string

Token that identifies area

query Parameters
includeArea
boolean
Default: false

Include area information

includeAsset
boolean
Default: false

Include asset information

includeCustomer
boolean
Default: false

Include customer information

includeDevice
boolean
Default: false

Include device information

page
integer <int32>
Default: 1

Page number

pageSize
integer <int32>
Default: 100

Page size

status
string

Limit results to the given status

Responses

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

get /areas/{areaToken}/assignments
null//localhost:8080/sitewhere/api/areas/{areaToken}/assignments

List command invocations for an area

Authorizations:
path Parameters
areaToken
required
string

Token that identifies area

query Parameters
endDate
string

End date

page
integer <int32>
Default: 1

Page number

pageSize
integer <int32>
Default: 100

Page size

startDate
string

Start date

Responses

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

get /areas/{areaToken}/invocations
null//localhost:8080/sitewhere/api/areas/{areaToken}/invocations

Get label for area

Authorizations:
path Parameters
areaToken
required
string

Token that identifies area

generatorId
required
string

Generator id

Responses

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

get /areas/{areaToken}/label/{generatorId}
null//localhost:8080/sitewhere/api/areas/{areaToken}/label/{generatorId}

List locations for an area

Authorizations:
path Parameters
areaToken
required
string

Token that identifies area

query Parameters
endDate
string

End date

page
integer <int32>
Default: 1

Page number

pageSize
integer <int32>
Default: 100

Page size

startDate
string

Start date

Responses

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

get /areas/{areaToken}/locations
null//localhost:8080/sitewhere/api/areas/{areaToken}/locations

List measurements for an area

Authorizations:
path Parameters
areaToken
required
string

Token that identifies area

query Parameters
endDate
string

End date

page
integer <int32>
Default: 1

Page number

pageSize
integer <int32>
Default: 100

Page size

startDate
string

Start date

Responses

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

get /areas/{areaToken}/measurements
null//localhost:8080/sitewhere/api/areas/{areaToken}/measurements

List command responses for an area

Authorizations:
path Parameters
areaToken
required
string

Token that identifies area

query Parameters
endDate
string

End date

page
integer <int32>
Default: 1

Page number

pageSize
integer <int32>
Default: 100

Page size

startDate
string

Start date

Responses

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

get /areas/{areaToken}/responses
null//localhost:8080/sitewhere/api/areas/{areaToken}/responses

List state changes associated with an area

Authorizations:
path Parameters
areaToken
required
string

Token that identifies area

query Parameters
endDate
string

End date

page
integer <int32>
Default: 1

Page number

pageSize
integer <int32>
Default: 100

Page size

startDate
string

Start date

Responses

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

get /areas/{areaToken}/statechanges
null//localhost:8080/sitewhere/api/areas/{areaToken}/statechanges

asset-types

Asset Types

List asset types matching criteria

Authorizations:
query Parameters
page
integer <int32>
Default: 1

Page number

pageSize
integer <int32>
Default: 100

Page size

Responses

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

get /assettypes
null//localhost:8080/sitewhere/api/assettypes

Create a new asset type

Authorizations:
Request Body schema: application/json
assetCategory
string
Enum:"Device" "Person" "Hardware"
backgroundColor
string
borderColor
string
description
string
foregroundColor
string
icon
string
imageUrl
string
metadata
object
name
string
token
string

Responses

200

OK

201

Created

401

Unauthorized

403

Forbidden

404

Not Found

post /assettypes
null//localhost:8080/sitewhere/api/assettypes

Request samples

application/json
Copy
Expand all Collapse all
{
  • "assetCategory": "Device",
  • "backgroundColor": "string",
  • "borderColor": "string",
  • "description": "string",
  • "foregroundColor": "string",
  • "icon": "string",
  • "imageUrl": "string",
  • "metadata":
    {
    },
  • "name": "string",
  • "token": "string"
}

Get asset by token

Authorizations:
path Parameters
assetTypeToken
required
string

Asset type token

Responses

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

get /assettypes/{assetTypeToken}
null//localhost:8080/sitewhere/api/assettypes/{assetTypeToken}

Update an existing hardware asset in category

Authorizations:
path Parameters
assetTypeToken
required
string

Asset type token

Request Body schema: application/json
assetCategory
string
Enum:"Device" "Person" "Hardware"
backgroundColor
string
borderColor
string
description
string
foregroundColor
string
icon
string
imageUrl
string
metadata
object
name
string
token
string

Responses

200

OK

201

Created

401

Unauthorized

403

Forbidden

404

Not Found

put /assettypes/{assetTypeToken}
null//localhost:8080/sitewhere/api/assettypes/{assetTypeToken}

Request samples

application/json
Copy
Expand all Collapse all
{
  • "assetCategory": "Device",
  • "backgroundColor": "string",
  • "borderColor": "string",
  • "description": "string",
  • "foregroundColor": "string",
  • "icon": "string",
  • "imageUrl": "string",
  • "metadata":
    {
    },
  • "name": "string",
  • "token": "string"
}

Delete asset type by token

Authorizations:
path Parameters
assetTypeToken
required
string

Asset type token

Responses

200

OK

204

No Content

401

Unauthorized

403

Forbidden

delete /assettypes/{assetTypeToken}
null//localhost:8080/sitewhere/api/assettypes/{assetTypeToken}

Get label for area

Authorizations:
path Parameters
assetTypeToken
required
string

Asset type token

generatorId
required
string

Generator id

Responses

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

get /assettypes/{assetTypeToken}/label/{generatorId}
null//localhost:8080/sitewhere/api/assettypes/{assetTypeToken}/label/{generatorId}

assets

Assets

List assets matching criteria

Authorizations:
query Parameters
assetTypeToken
string

Limit by asset type

includeAssetType
boolean
Default: false

Include asset type

page
integer <int32>
Default: 1

Page number

pageSize
integer <int32>
Default: 100

Page size

Responses

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

get /assets
null//localhost:8080/sitewhere/api/assets

Create a new asset

Authorizations:
Request Body schema: application/json