Skip to main content
Version: 2.0

Maps

Introduction

Maps allow users to visualize their access control system by assigning coordinates to devices. There are two types of maps:

  • Local maps are based on user-provided images, with coordinates provided as pixel values relative to the top left corner of each image. A system may contain multiple local maps.
  • Global maps are based on third-party mapping services (like Google Maps), with coordinates provided as geographical latitude and longitude values. A system may only contain one global map.

Note that pdk.io currently only supports local maps, but global maps may be utilized by third-party applications.

The map object

{
"id": "0b4078ac-f150-46d2-b320-b0a0544f8bfd",
"name": "Test Map 1",
"description": "Test Map 1",
"partitions": ["619cceb0-ac58-4b15-a8ec-32efcb0476ba"],
"type": "local",
"imageUrl": "http://systems.pdk.io/images/22ba2c70-631a-11ee-90fc-598e4a89e620",
"opacity": 100,
"iconSize": "M",
"devices": [
{
"id": "f90bef5c-1a2b-4763-9fc4-f059c6fd55ba",
"displayName": true,
"x": 100,
"y": 100
}
],
"links": [
{
"id": "9c179bb0-b669-4921-a380-fbd60b0a44ed",
"name": "Test Map 2",
"x": 200,
"y": 200
}
]
}
PropertyTypeDescription
idStringThe map ID.
nameStringThe map name.
descriptionStringThe map description.
partitionsString[]The partition IDs associated with this map.
typeStringThe map type. Possible values include local and global.
imageUrlStringThe URL of the user-provided map image.
opacityIntegerThe image opacity.
iconSizeStringThe icon size. Possible values include S, M, and L.
devicesObject[]An array of devices and their accompanying coordinates.
devices.idStringThe device ID.
devices.displayNameBooleanWhether the device name is displayed alongside the icon.
devices.xIntegerThe horizontal pixel coordinate of the device relative to the top left of the image.
devices.yIntegerThe vertical pixel coordinate of the device relative to the top left of the image.
linksObject[]An array of linked maps and their accompanying coordinates.
links.idStringThe linked map ID.
links.xIntegerThe horizontal pixel coordinate of the linked map relative to the top left of the image.
links.yIntegerThe vertical pixel coordinate of the linked map relative to the top left of the image.

Basic Endpoints

Create a map

Request

POST https://systems.pdk.io/{{system_id}}/maps HTTP/1.1
Authorization: Bearer {{system_token}}
Content-Type: application/json

{
"name": "Test Map 1",
"description": "Test Map 1",
"partitions": ["619cceb0-ac58-4b15-a8ec-32efcb0476ba"],
"type": "local",
"image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAAAAAAcD2kOAAABZklEQVR4Ae3XAYnDMBTG8RqogBqIgRqogBiYgRiogBqYgRiIgBh4Bj5Rd13yIAs5uHHrGwffH2DNI+MH3cLWCR+KMGHChAkTJkz4tQgTJkyYMGHChAkTJkyYcIqDZDAXlOQevqtLiYPSr+B1GhQH84iztOnaHQDiNGi9AA7txCUrWF1tsYJ7JvwFvq2PlvqeUlJ4qYMyq5/vFoI7X2dBWktTu/v2wnHSm9jfiYAmKXvu53X29aI0dbvfC8enG5kTbGEHzRiednNY9BQd+XJ4DaUDZ27S3C5Xwv3RvLcjL3YwfDubkx2M0MtWMHJYmul1sB/8xKbgVM4mx6m1Kx2tYcjyIRjeFJZtU8qZwar5fF4d5TzhGrj/I7DXQxT0a+0vg9tinrvJnG1g6UcHbGBgn5v1fMAMhuxOlz7jLXCOj6D9+AiTyxMMnitbMp8WCRMmTJgwYcKECRMmTJgwYcKECRMmTPhfwV9kH2srWmFAYQAAAABJRU5ErkJggg==",
"opacity": 100,
"devices": [
{
"id": "f90bef5c-1a2b-4763-9fc4-f059c6fd55ba",
"displayName": true,
"x": 100,
"y": 100
}
],
"links": [
{
"id": "9c179bb0-b669-4921-a380-fbd60b0a44ed",
"name": "Test Map 2",
"x": 200,
"y": 200
}
]
}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
system_tokenHeaderStringYesA valid system token.
nameBodyStringYesThe map name. This must be unique within a system.
descriptionBodyStringYesThe map description. This must be unique within a system.
partitionsBodyString[]YesThe partition IDs associated with this map.
typeBodyStringYesThe map type. Possible values include local and global.
imageBodyStringYesThe map image encoded as a data URL.
opacityBodyIntegerNoThe image opacity. Adjusting the opacity may help improve the readability of overlaid text. The minimum value is 0 (default) and the maximum value is 100. While not strictly required, this value should always be specified since the image will otherwise be invisible by default.
iconSizeBodyStringNoThe icon size. Possible values include S, M, and L.
devicesBodyObject[]YesAn array of devices and their accompanying coordinates.
devices.idBodyStringYesThe device ID.
devices.displayNameBodyBooleanYesWhether the device name should be displayed alongside the icon.
devices.xBodyIntegerYesThe horizontal pixel coordinate of the device relative to the top left of the image.
devices.yBodyIntegerYesThe vertical pixel coordinate of the device relative to the top left of the image.
linksBodyObject[]YesAn array of linked maps and their accompanying coordinates.
links.idBodyStringYesThe linked map ID.
links.xBodyIntegerYesThe horizontal pixel coordinate of the linked map relative to the top left of the image.
links.yBodyIntegerYesThe vertical pixel coordinate of the linked map relative to the top left of the image.

Response

The response contains the ID of the newly created map object.

HTTP/1.1 200 OK
Content-Type: application/json

{
"id": "0b4078ac-f150-46d2-b320-b0a0544f8bfd"
}

Retrieve a map

Request

GET https://systems.pdk.io/{{system_id}}/maps/{{map_id}} HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
map_idPathStringYesThe map ID.
system_tokenHeaderStringYesA valid system token.

Response

The response contains a map object.

HTTP/1.1 200 OK
Content-Type: application/json

{
"id": "0b4078ac-f150-46d2-b320-b0a0544f8bfd",
"name": "Test Map 1",
"description": "Test Map 1",
"partitions": ["619cceb0-ac58-4b15-a8ec-32efcb0476ba"],
"type": "local",
"imageUrl": "http://systems.pdk.io/images/22ba2c70-631a-11ee-90fc-598e4a89e620",
"opacity": 100,
"iconSize": "M",
"devices": [
{
"id": "f90bef5c-1a2b-4763-9fc4-f059c6fd55ba",
"displayName": true,
"x": 100,
"y": 100
}
],
"links": [
{
"id": "9c179bb0-b669-4921-a380-fbd60b0a44ed",
"name": "Test Map 2",
"x": 200,
"y": 200
}
]
}

Update a map

Request

PUT https://systems.pdk.io/{{system_id}}/maps/{{map_id}} HTTP/1.1
Authorization: Bearer {{system_token}}
Content-Type: application/json

{
"name": "Test Map 1",
"description": "Test Map 1",
"partitions": ["619cceb0-ac58-4b15-a8ec-32efcb0476ba"],
"type": "local",
"image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAAAAAAcD2kOAAABZklEQVR4Ae3XAYnDMBTG8RqogBqIgRqogBiYgRiogBqYgRiIgBh4Bj5Rd13yIAs5uHHrGwffH2DNI+MH3cLWCR+KMGHChAkTJkz4tQgTJkyYMGHChAkTJkyYcIqDZDAXlOQevqtLiYPSr+B1GhQH84iztOnaHQDiNGi9AA7txCUrWF1tsYJ7JvwFvq2PlvqeUlJ4qYMyq5/vFoI7X2dBWktTu/v2wnHSm9jfiYAmKXvu53X29aI0dbvfC8enG5kTbGEHzRiednNY9BQd+XJ4DaUDZ27S3C5Xwv3RvLcjL3YwfDubkx2M0MtWMHJYmul1sB/8xKbgVM4mx6m1Kx2tYcjyIRjeFJZtU8qZwar5fF4d5TzhGrj/I7DXQxT0a+0vg9tinrvJnG1g6UcHbGBgn5v1fMAMhuxOlz7jLXCOj6D9+AiTyxMMnitbMp8WCRMmTJgwYcKECRMmTJgwYcKECRMmTPhfwV9kH2srWmFAYQAAAABJRU5ErkJggg==",
"opacity": 100,
"devices": [
{
"id": "f90bef5c-1a2b-4763-9fc4-f059c6fd55ba",
"displayName": true,
"x": 100,
"y": 100
}
],
"links": [
{
"id": "9c179bb0-b669-4921-a380-fbd60b0a44ed",
"name": "Test Map 2",
"x": 200,
"y": 200
}
]
}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
map_idPathStringYesThe map ID.
system_tokenHeaderStringYesA valid system token.
nameBodyStringYesThe map name. This must be unique within a system.
descriptionBodyStringYesThe map description. This must be unique within a system.
partitionsBodyString[]YesThe partition IDs associated with this map.
typeBodyStringYesThe map type. Possible values include local and global.
imageBodyStringYesThe map image encoded as a data URL.
opacityBodyIntegerNoThe image opacity. Adjusting the opacity may help improve the readability of overlaid text. The minimum value is 0 (default) and the maximum value is 100. While not strictly required, this value should always be specified since the image will otherwise be invisible by default.
iconSizeBodyStringNoThe icon size. Possible values include S, M, and L.
devicesBodyObject[]YesAn array of devices and their accompanying coordinates.
devices.idBodyStringYesThe device ID.
devices.displayNameBodyBooleanYesWhether the device name should be displayed alongside the icon.
devices.xBodyIntegerYesThe horizontal pixel coordinate of the device relative to the top left of the image.
devices.yBodyIntegerYesThe vertical pixel coordinate of the device relative to the top left of the image.
linksBodyObject[]YesAn array of linked maps and their accompanying coordinates.
links.idBodyStringYesThe linked map ID.
links.xBodyIntegerYesThe horizontal pixel coordinate of the linked map relative to the top left of the image.
links.yBodyIntegerYesThe vertical pixel coordinate of the linked map relative to the top left of the image.

Response

HTTP/1.1 204 No Content

Delete a map

Request

DELETE https://systems.pdk.io/{{system_id}}/maps/{{map_id}} HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
map_idPathStringYesThe map ID.
system_tokenHeaderStringYesA valid system token.

Response

HTTP/1.1 204 No Content

List all maps

Request

GET https://systems.pdk.io/{{system_id}}/maps HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
system_tokenHeaderStringYesA valid system token.

Response

The response contains an array of map objects.

HTTP/1.1 200 OK
Content-Type: application/json

[
{
"id": "0b4078ac-f150-46d2-b320-b0a0544f8bfd",
"name": "Test Map 1",
"description": "Test Map 1",
"partitions": ["619cceb0-ac58-4b15-a8ec-32efcb0476ba"],
"type": "local",
"imageUrl": "http://systems.pdk.io/images/22ba2c70-631a-11ee-90fc-598e4a89e620",
"opacity": 100,
"iconSize": "M",
"devices": [
{
"id": "f90bef5c-1a2b-4763-9fc4-f059c6fd55ba",
"displayName": true,
"x": 100,
"y": 100
}
],
"links": [
{
"id": "9c179bb0-b669-4921-a380-fbd60b0a44ed",
"name": "Test Map 2",
"x": 200,
"y": 200
}
]
}
]