Beacons (GET)

Retrieves the beacon with the UUID, major number, and minor number.

Description

The beacons are retrieved based on which of the query parameters are mentioned:
  • UUID, major number, and minor number are all specified: returns the details of a specific beacon.
  • Only UUID and major number are specified: returns the details of all beacons with matching UUID and major number.
  • Only UUID and minor number are specified: returns the details of all beacons with matching UUID and minor number.
  • Only UUID is specified: returns the details of all beacons with matching UUID.
  • None are specified: returns the details of all beacons.

Roles

Users in the following roles are authorized to perform this operation:

  • worklightadmin
  • worklightdeployer
  • worklightmonitor
  • worklightoperator

Method

GET

Path

/management-apis/1.0/beacons

Example

https://www.example.com/worklightadmin/management-apis/1.0/beacons?errorIfNotFound=true&locale=de_DE&major=1&minor=4439&uuid=3d402cf0-3691-4bd9-97ff-0b0a93a160ef

Query Parameters

Query parameters are optional.

errorIfNotFound
If this flag is set to true (default value), and uuid and/or major/minor parameters are specified for which there are no matching beacons, then 'HTTP 404 Not Found' error is returned instead of an empty list in the output.
locale
The locale used for error messages.
major
The major number of the beacon.
minor
The minor number of the beacon.
uuid
The UUID of the beacon.

Produces

application/json, application/xml, text/xml

Response

The details of all the beacons that are retrieved.

JSON Example

{
  "beacons" : [
    {
      "customData" : {
        "beaconLocation" : "loanSection",
        "branchName" : "Indiranagar, Bangalore",
      },
      "latitude" : 12.952,
      "longitude" : 77.644,
      "major" : 1,
      "minor" : 4439,
      "uuid" : "3d402cf0-3691-4bd9-97ff-0b0a93a160ef",
    },
    ...
  ],
  "productVersion" : 7.0.0,
}

XML Example

<?xml version="1.0" encoding="UTF-8"?>
<list-beacons-result productVersion="7.0.0">
  <beacons>
    <beacon
      latitude="12.952"
      longitude="77.644"
      major="1"
      minor="4439"
      uuid="3d402cf0-3691-4bd9-97ff-0b0a93a160ef">
      <customData
        beaconLocation="loanSection"
        branchName="Indiranagar, Bangalore"/>
    </beacon>
    ...
  </beacons>
</list-beacons-result>

Response Properties

The response has the following properties:

beacons
The array of beacons
productVersion
The exact product version.

The beacons has the following properties:

customData
Optional: Any other customer-specific data that is associated with this beacon like branch/store where this beacon is deployed.
latitude
Optional latitude where the beacon is deployed.
longitude
Optional longitude where the beacon is deployed.
major
The major number of the beacon.
minor
The minor number of the beacon.
uuid
The UUID of the beacon.

The customData has the following properties:

beaconLocation
The physical location of the beacon.
branchName
The branch where the beacon is installed.

Errors

401
Unauthorized - The caller is either not authenticated or not authorized to make this request.
404
A beacon with the specified uuid and/or major/minor is not found and errorIfNotFound flag was either not specified or was set to true.
406
Unsupported Accept type - The content type specified in Accept header is not application/json, application/xml or text/xml.
500
An internal error occurred.