2.13. Access Point creation
It is possible to create a new Access Point by submitting a POST request to the following URI:
https://hostname/api/v1/access_points
To successfully create a new access point it is required to provide a sensor_uuid (sensor UUID of which the newly created AP will be descendant). If said parameter is not given a HTTP 404 Not Found status code will be returned. It is also required that the user submitting the request can manage the sensor specified. If the user does not have permission a HTTP 401 Unauthorized status code will be returned. APs validate name and mac_address on creation thus making said parameters mandatory. If either of these parameters are missing a HTTP 422 Unprocessable Entity status code will be returned along with the specific error on the requested format.
The following parameters are also accepted on the request payload:
ip_address
IP address of the new access point.
mac_address
(mandatory) MAC address of the access point.
name
(mandatory) Name given to the access point.
status
Status of the access point supplied as an integer. 0 stands for down or offline; 1 stands for up or online
latitude
Latitude coordinate to locate the access point
longitude
Longitude coordinate to locate the access point
x
Integer representig the abscissa coordinate in a floor map locating the access point
y
Integer representig the ordinate coordinate in a floor map locating the access point
sensor_uuid
(mandatory) Parent sensor UUID. It should always be a domain.
flow_uuid
Associated flow sensor UUID.
description
Description of the newly created access point.
enrichment
Explained below.
You may also provide the access point enrichment parameters as a JSON object for the "enrichment" tag. The enrichment tag allows four possible values, these are:
market_uuid
UUID of the market the access point belongs to.
campus_uuid
UUID of the campus the access point belongs to.
building_uuid
UUID of the building the access point belongs to.
floor_uuid
UUID of the floor the access point belongs to.
An example request can be found on the following lines:
Request:
HTTP Verb: POST
URI: https://hostname/api/v1/access_points.json?auth_token=xxxxxx
Payload: { "mac_address":"ed:f4:22:45:ff:ef","enrichment": {
"campus_uuid": "84758975876475",
"floor_uuid": "8001483943459605430"
}, "sensor_uuid":"5654545586888876551", "name":"Demo_AP6", "flow_uuid":"89479888298873783"}
Response:
{
"query": true,
"ap": {
"id": 776,
"ip_address": null,
"mac_address": "ed:f4:22:45:ff:ef",
"name": "Demo_Access_Point",
"switch_name": null,
"switch_id": null,
"latitude": null,
"longitude": null,
"x": null,
"y": null,
"sensor_id": 265,
"created_at": "2015-06-02T11:33:54.841+02:00",
"updated_at": "2015-06-02T11:33:54.841+02:00",
"description": null,
"status": 0,
"last_check_in": null,
"clients": 0,
"uptime": 0,
"enrichment": {
"campus_uuid": "84758975876475",
"floor_uuid": "8001483943459605430"
},
"sensor_name": "Restaurant",
"sensor_uuid": "5654545586888876551"
}
}