Return Places by Query

post

/mobile/platform/location/places/query

Call this operation to retrieve the places and, optionally, the associated devices that match the query properties that you specify in the request body.

Permissions

You can access this operation as a social user, a virtual user, an anonymous user, or a mobile user. If you access this operation as a virtual user or a mobile user, then you must have the role that's associated with the mobile backend.

Request

Supported Media Types
Body ()
Root Schema : Query Parameters
Type: object
Title: Query Parameters
Show Source
  • Attributes
    Title: Attributes
    Additional Properties Allowed: additionalProperties
    The attributes entered in the UI, as key/value pairs.
  • Default Value: false
    Set to `true` to include in the response the `descendantDevices` property, which lists the devices that are associated with this place and all its child places.
  • Return places that are direct descendants of this place ID. When you use this query parameter, don't combine it with other parameters.
  • Filter results based on a case-insensitive partial match of this string with the place's description.
  • Default Value: long
    Allowed Values: [ "short", "long" ]
    The response is in long format by default. Specify `short` to return only the `id`, `name`, `description`, and `protocol` properties.
  • gpsCircle
    GPS circle.
  • Filter results based on a partial match of this string with the label.
  • Minimum Value: 0
    Maximum Value: 100
    Default Value: 40
    Maximum number of items to return (between 0 and 100). If the requested limit is greater than `100`, then `100` is substituted.
  • listOfPlaces
    Place ID(s) to search for. For example `[15,16]`.
  • Filter results based on a case-insensitive partial match of this string with the place's user-defined name.
  • gpsPoint
    GPS point.
  • Default Value: 0
    Zero-based index of the first item to return.
  • Allowed Values: [ "name", "label", "createdOn", "modifiedOn" ]
    Field to order results by. Requires either `:asc` for ascending or `:desc` for descending. Example: `createdOn:asc`.
Nested Schema : Attributes
Type: object
Title: Attributes
Additional Properties Allowed
Show Source
The attributes entered in the UI, as key/value pairs.
Show Source
Nested Schema : gpsCircle
Type: object
GPS circle.
Show Source
Nested Schema : listOfPlaces
Type: array
Place ID(s) to search for. For example `[15,16]`.
Show Source
Nested Schema : gpsPoint
Type: object
GPS point.
Show Source
Example Request (application/json)
{
    "offset":0,
    "inGeoFence":{
        "gpsCircle":{
            "latitude":37.4996,
            "radius":180000,
            "longitude":122.262
        }
    },
    "limit":2,
    "format":"long",
    "orderBy":"name:asc"
}

Response

Supported Media Types

200 Response

The places that matched the query parameters were retrieved successfully.
Body ()
Root Schema : Query Results
Type: object
Title: Query Results
Show Source
Nested Schema : items
Type: array
Minimum Number of Items: 1
Places found.
Show Source
  • Place
    Title: Place
    The long format includes all properties. The short format contains only `id`, `name`, `description`, and `label`. The short format applies to `POST /mobile/platform/location/places` responses only.
Nested Schema : Place
Type: object
Title: Place
The long format includes all properties. The short format contains only `id`, `name`, `description`, and `label`. The short format applies to `POST /mobile/platform/location/places` responses only.
Show Source
Nested Schema : Place's Address
Type: object
Title: Place's Address
GPS address of the place.
Match One
Show Source
Nested Schema : Attributes
Type: object
Title: Attributes
Additional Properties Allowed
Show Source
The attributes entered in the UI, as key/value pairs.
Show Source
Nested Schema : children
Type: array
Minimum Number of Items: 0
Places that are the child places of this place. This includes the full hierarchy of places that descend from this place.
Show Source
  • Place
    Title: Place
    The long format includes all properties. The short format contains only `id`, `name`, `description`, and `label`. The short format applies to `POST /mobile/platform/location/places` responses only.
Nested Schema : descendantDevices
Type: array
Minimum Number of Items: 0
Devices that are associated with this place and all its child places. This property is included in query results when the `descendantDevices` query parameter is set to `true`. All devices found are included in short form only.
Show Source
  • Location Device
    Title: Location Device
    The properties for a location device. The long format includes all properties. The short format applies to `POST /mobile/platform/location/devices` responses only.
Nested Schema : devices
Type: array
Minimum Number of Items: 0
Devices associated with this asset. Typically one device, but there can be multiple devices.
Show Source
  • Associated Location Device
    Title: Associated Location Device
    The properties for an associated location device. Note that this object doesn't contain the `asset` and `place` properties.
Nested Schema : gpsPoint
Type: object
GPS point.
Show Source
Nested Schema : gpsCircle
Type: object
GPS circle.
Show Source
Nested Schema : gpsPolygon
Type: object
GPS polygon.
Show Source
Nested Schema : vertices
Type: array
Minimum Number of Items: 1
GPS polygon's vertices.
Show Source
Nested Schema : latitudeLongitudePair
Type: object
Pair of latitude and longitude values for a place.
Show Source
Nested Schema : Location Device
Type: object
Title: Location Device
The properties for a location device. The long format includes all properties. The short format applies to `POST /mobile/platform/location/devices` responses only.
Show Source
Nested Schema : Associated Asset
Type: object
Title: Associated Asset
The properties for an associated asset. This object doesn't include the `devices` property because the associated device is the containing object.
Show Source
Nested Schema : Beacon
Type: object
Title: Beacon
Device's identifying information.
Match One
Show Source
Nested Schema : Associated Place
Type: object
Title: Associated Place
The properties for an associated place. This object doesn't include the `devices` property because the associated device is the containing object.
Show Source
Nested Schema : Last Known Location
Type: object
Title: Last Known Location
Last known location of the asset.
Match One
Show Source
Nested Schema : iBeacon
Type: object
iBeacon device.
Show Source
Nested Schema : altBeacon
Type: object
AltBeacon device.
Show Source
Nested Schema : eddystone
Type: object
Eddystone device.
Show Source
Nested Schema : eddystoneUid
Type: object
Device's UID.
Show Source
Nested Schema : eddystoneUrl
Type: object
Device's URL.
Show Source
Nested Schema : Associated Location Device
Type: object
Title: Associated Location Device
The properties for an associated location device. Note that this object doesn't contain the `asset` and `place` properties.
Show Source
Example Response (application/json)
{
    "totalResults":203,
    "offset":0,
    "limit":2,
    "count":2,
    "hasMore":true,
    "items":[
        {
            "address":{
                "gpsPoint":{
                    "latitude":122,
                    "longitude":37
                }
            },
            "devices":[
                {
                    "modifiedOn":"2015-08-08T07:22:44.654Z",
                    "beacon":{
                        "iBeacon":{
                            "major":"1.0",
                            "minor":"1.1",
                            "uuid":"B9407F30-F5F8-466E-AFF9-25556B57FE6D"
                        }
                    },
                    "createdBy":"jdoe",
                    "name":"RC_WH_01_F01_B001",
                    "description":"Beacon on 1st Floor in FixitFast Warehouse in Redwood City",
                    "modifiedBy":"tsmith",
                    "links":[
                        {
                            "rel":"canonical",
                            "href":"/mobile/platform/location/devices/12345"
                        },
                        {
                            "rel":"self",
                            "href":"/mobile/platform/location/devices/12345"
                        }
                    ],
                    "attributes":{
                        "visibility":"Public",
                        "manufacturerId":"10D39AE7-020E-4467-9CB2-DD36366F899D",
                        "manufacturer":"Abc Company",
                        "status":"Active"
                    },
                    "id":12345,
                    "createdOn":"2015-08-06T18:37:59.424Z"
                }
            ],
            "hasChildren":false,
            "description":"FixItFast Warehouse in Redwood City",
            "label":"FixItFast Warehouse",
            "createdOn":"2015-08-06T18:37:59.424Z",
            "modifiedOn":"2015-08-06T18:37:59.424Z",
            "createdBy":"jdoe",
            "parentPlace":42,
            "name":"FixItFast Redwood City Warehouse",
            "modifiedBy":"jdoe",
            "links":[
                {
                    "rel":"canonical",
                    "href":"/mobile/platform/location/places/112"
                },
                {
                    "rel":"self",
                    "href":"/mobile/platform/location/places/112"
                }
            ],
            "attributes":{
                "hours":"9am-6pm"
            },
            "id":112
        },
        {
            "address":{
                "gpsCircle":{
                    "latitude":123,
                    "radius":300,
                    "longitude":37
                }
            },
            "devices":[
                {
                    "modifiedOn":"2015-08-08T07:22:44.654Z",
                    "beacon":{
                        "iBeacon":{
                            "major":"1.0",
                            "minor":"1.1",
                            "uuid":"B9407F30-F5F8-466E-AFF9-25556B57FE6D"
                        }
                    },
                    "createdBy":"jdoe",
                    "name":"RC_WH_01_F01_B001",
                    "description":"Beacon on 1st Floor in FixitFast Warehouse in Redwood City",
                    "modifiedBy":"tsmith",
                    "links":[
                        {
                            "rel":"canonical",
                            "href":"/mobile/platform/location/devices/111"
                        },
                        {
                            "rel":"self",
                            "href":"/mobile/platform/location/devices/111"
                        }
                    ],
                    "attributes":{
                        "visibility":"Public",
                        "manufacturerId":"10D39AE7-020E-4467-9CB2-DD36366F899D",
                        "manufacturer":"Abc Company",
                        "status":"Active"
                    },
                    "id":111,
                    "createdOn":"2015-08-06T18:37:59.424Z"
                },
                {
                    "modifiedOn":"2015-08-12T07:22:44.654Z",
                    "beacon":{
                        "iBeacon":{
                            "major":"1.0",
                            "minor":"1.1",
                            "uuid":"B9407F30-F5F8-466E-AFF9-25552345908234DD0"
                        }
                    },
                    "createdBy":"jdoe",
                    "name":"RC_WH_01_F01_B996",
                    "description":"Beacon on 2nd Floor in FixitFast Warehouse in Redwood City",
                    "modifiedBy":"tsmith",
                    "links":[
                        {
                            "rel":"canonical",
                            "href":"/mobile/platform/location/devices/222"
                        },
                        {
                            "rel":"self",
                            "href":"/mobile/platform/location/devices/222"
                        }
                    ],
                    "attributes":{
                        "visibility":"Public",
                        "manufacturerId":"10D39AE7-020E-4467-9CB2-DD36366F899D",
                        "manufacturer":"Abc Company",
                        "status":"Active"
                    },
                    "id":222,
                    "createdOn":"2015-08-08T18:37:59.424Z"
                }
            ],
            "hasChildren":false,
            "description":"FixItFast Warehouse in Palo Alto",
            "label":"FixItFast Warehouse",
            "createdOn":"2015-08-06T19:27:59.424Z",
            "modifiedOn":"2015-08-06T19:27:59.424Z",
            "createdBy":"jdoe",
            "parentPlace":42,
            "name":"FixItFast Palo Alto Warehouse",
            "modifiedBy":"jdoe",
            "links":[
                {
                    "rel":"canonical",
                    "href":"/mobile/platform/location/places/325"
                },
                {
                    "rel":"self",
                    "href":"/mobile/platform/location/places/325"
                }
            ],
            "attributes":{
                "hours":"9am-6pm"
            },
            "id":325
        }
    ]
}

400 Response

The request failed because the JSON payload for the query is not well-formed, or because an exception occurred during processing.

Body ()
Root Schema : Error
Type: object
Title: Error
The error JSON object returned by the service.
Show Source
Nested Schema : o:errorDetails
Type: array
Minimum Number of Items: 0
List of the issues that cause the error. Included when the error is caused by multiple issues.
Show Source
Nested Schema : Error Detail
Type: object
Title: Error Detail
Show Source

Examples

This example shows how to use cURL to retrieve information about places by submitting a POST request on the REST resource.

curl -i \
-X POST \ 
-u mobile.user@example.com:password \
-d @places.json \
-H "Content-Type: application/json; charset=utf-8" \
-H "Oracle-Mobile-Backend-ID: ABCD9278-091f-41aa-9cb2-184bd0586fce" \
https://fif.cloud.oracle.com/mobile/platform/location/places/query

Example of Request Body

Here's an example of the request body in JSON format. This example requests , in ascending name order, information about all places where the label includes the string commercial (case-insensitive match) and that are in a defined circle with the specified radius where the center is at the given latitude and longitude. This request asks for the first two search results. If you subsequently want to get the next set of places, starting with the third place, you would send another request with the offset set to 2. Note that it is requesting the long format of the response body. If the value was short, then the response body would include id, name, description, and label only.

{
  "label":"commercial",
  "inGeoFence":{
    "gpsCircle":{
      "longitude":122.262,
      "latitude":37.4996,
      "radius":180000
    }
  },
  "orderBy":"name:asc",
  "offset":0,
  "limit":2,
  "format":"long"
}

Example of Response Header

Here's an example of the response header:

200 OK
Content-Length: 1173
Content-Type: application/json
Date: Tue, 16 Jun 2015 01:39:07 GMT

Example of Response Body

This example shows the contents of the response body in JSON format, which is an array of the matching items:

{
    "items":[
        {
            "devices":[
                {
                    "id":12345,
                    "createdBy":"jdoe",
                    "name":"RC_WH_01_F01_B001",
                    "createdOn":"2015-08-06T18:37:59.424Z",
                    "modifiedOn":"2015-08-08T07:22:44.654Z",
                    "beacon":{
                        "iBeacon":{
                            "uuid":"B9407F30-F5F8-466E-AFF9-25556B57FE6D",
                            "major":"1.0",
                            "minor":"1.1"}},
                    "modifiedBy":"tsmith",
                    "links":[
                        {
                            "rel":"canonical",
                            "href":"/mobile/platform/location/devices/12345"},
                        {
                            "rel":"self",
                            "href":"/mobile/platform/location/devices/12345"}
                    ],
                    "attributes":{
                        "manufacturer":"Abc Company",
                        "manufacturerId":"10D39AE7-020E-4467-9CB2-DD36366F899D",
                        "status":"Active",
                        "visibility":"Public"},
                    "description":"Beacon on 1st Floor in FixitFast Warehouse in Redwood City"}
            ],
            "label":"FixItFast Warehouse",
            "id":112,
            "createdBy":"jdoe",
            "name":"FixItFast Redwood City Warehouse",
            "createdOn":"2015-08-06T18:37:59.424Z",
            "modifiedOn":"2015-08-06T18:37:59.424Z",
            "address":{
                "gpsPoint":{
                    "latitude":122,
                    "longitude":37}},
            "modifiedBy":"jdoe",
            "links":[
                {
                    "rel":"canonical",
                    "href":"/mobile/platform/location/places/112"},
                {
                    "rel":"self",
                    "href":"/mobile/platform/location/places/112"}
            ],
            "attributes":{
                "hours":"9am-6pm"},
            "hasChildren":false,
            "parentPlace":42,
            "description":"FixItFast Warehouse in Redwood City"},
        {
            "devices":[
                {
                    "id":111,
                    "createdBy":"jdoe",
                    "name":"RC_WH_01_F01_B001",
                    "createdOn":"2015-08-06T18:37:59.424Z",
                    "modifiedOn":"2015-08-08T07:22:44.654Z",
                    "beacon":{
                        "iBeacon":{
                            "uuid":"B9407F30-F5F8-466E-AFF9-25556B57FE6D",
                            "major":"1.0",
                            "minor":"1.1"}},
                    "modifiedBy":"tsmith",
                    "links":[
                        {
                            "rel":"canonical",
                            "href":"/mobile/platform/location/devices/111"},
                        {
                            "rel":"self",
                            "href":"/mobile/platform/location/devices/111"}
                    ],
                    "attributes":{
                        "manufacturer":"Abc Company",
                        "manufacturerId":"10D39AE7-020E-4467-9CB2-DD36366F899D",
                        "status":"Active",
                        "visibility":"Public"},
                    "description":"Beacon on 1st Floor in FixitFast Warehouse in Redwood City"},
                {
                    "id":222,
                    "createdBy":"jdoe",
                    "name":"RC_WH_01_F01_B996",
                    "createdOn":"2015-08-08T18:37:59.424Z",
                    "modifiedOn":"2015-08-12T07:22:44.654Z",
                    "beacon":{
                        "iBeacon":{
                            "uuid":"B9407F30-F5F8-466E-AFF9-25552345908234DD0",
                            "major":"1.0",
                            "minor":"1.1"}},
                    "modifiedBy":"tsmith",
                    "links":[
                        {
                            "rel":"canonical",
                            "href":"/mobile/platform/location/devices/222"},
                        {
                            "rel":"self",
                            "href":"/mobile/platform/location/devices/222"}
                    ],
                    "attributes":{
                        "manufacturer":"Abc Company",
                        "manufacturerId":"10D39AE7-020E-4467-9CB2-DD36366F899D",
                        "status":"Active",
                        "visibility":"Public"},
                    "description":"Beacon on 2nd Floor in FixitFast Warehouse in Redwood City"}
            ],
            "label":"FixItFast Warehouse",
            "id":325,
            "createdBy":"jdoe",
            "name":"FixItFast Palo Alto Warehouse",
            "createdOn":"2015-08-06T19:27:59.424Z",
            "modifiedOn":"2015-08-06T19:27:59.424Z",
            "address":{
                "gpsCircle":{
                    "latitude":123,
                    "longitude":37,
                    "radius":300}},
            "modifiedBy":"jdoe",
            "links":[
                {
                    "rel":"canonical",
                    "href":"/mobile/platform/location/places/325"},
                {
                    "rel":"self",
                    "href":"/mobile/platform/location/places/325"}
            ],
            "attributes":{
                "hours":"9am-6pm"},
            "hasChildren":false,
            "parentPlace":42,
            "description":"FixItFast Warehouse in Palo Alto"}
    ],
    "totalResults":203,
    "offset":0,
    "limit":2,
    "count":2,
    "hasMore":true
}