Smartspot location assignments can be changed through the Web API using an HTTP PUT request.
Retrieving the database ID of the Smartspot
First you will need to know the database ID of the Smartspot.
- Go the Brain and login.
- Go to
https://<brain-address>.intellifi.nl/api/spots?serial_number=<serial-number>
- Copy the
id
value under the results page. This value usually looks like this:5b2cadfb8be92f37e81f0999
HTTP PUT request on Web API spots resource
First, you will need to know where your Smartspot/Antennas need to be mapped to.
Fetching Locations from the Web API
- Go the Brain and login.
- Go to
https://<brain-address>.intellifi.nl/api/locations
- Copy the
id
value of the desired location under the results page. This value usually looks like this:5b72adf3baef61105c53012c
Changing Smartspot report location
The report location is the location where the Smartspot will send all of its presences to. This is only used when you do not want to distinguish between the Smartspot's different antennas.
- Use the following target URL:
https://<brain-address>.intellifi.nl/api/spots/<database-id>
- Use the following headers:
- Content-Type: application/json
- X-Api-Key: The Brain API key that was supplied to you.
- For the body we use JSON. In this example, we are going to change the
report_location
of the Smartspot.{ "report_location": "5b72adf3baef61105c53012c"
} - Send the request. An HTTP response with the status code 200 OK indicates the request was succesful.
Example using cURL
Using cURL in a terminal/console the request could look like the following:
curl -X PUT https://<brain-address>.intellifi.nl/api/spots/<database-id> -H 'Cache-Control: no-cache' -H 'Content-Type: application/json' -H 'X-Api-Key: <brain_api_key>' -d '{"report_location": "5b72adf3baef61105c53012c"}'
Changing Smartspot Antenna report locations
An antenna report location is a location where one or multiple different antennas of the Smartspot can be mapped to.
In the below example both antenna 3 and 4 are mapped to the same location.
- Use the following target URL:
https://<brain-address>.intellifi.nl/api/spots/<database-id>
- Use the following headers:
- Content-Type: application/json
- X-Api-Key: The Brain API key that was supplied to you.
- For the body we use JSON: In this example, we are going to change the
antenna_report_locations
of the Smartspot. We set thereport_location
to null so we will not get the situation where presences might occur on both thereport_location
andantenna_report_locations
.{ "report_location": null, "antenna_report_locations": [ { "antenna_number": 3, "report_location": "5b72adf3baef61105c53012c" }, { "antenna_number": 4, "report_location": "5b72adf3baef61105c53012c" } ] }
- Send the request. An HTTP response with the status code 200 OK indicates the request was succesful.
Example using cURL
Using cURL in a terminal/console the request could look like the following:
curl -X PUT -H 'Content-Type: application/json' -H 'X-Api-Key: <brain-api-key>' -d '{"report_location": null,"antenna_report_locations": [{"antenna_number": 3,"report_location": "5b72adf3baef61105c53012c"},{"antenna_number": 4,"report_location": "5576bdff5e19f67b0be508c1"}]}' https://<brain-address>.intellifi.nl/api/spots/<database-id>
Comments
0 comments
Article is closed for comments.