Return Assets by Query

post

/mobile/platform/location/assets/query

Call this operation to retrieve the assets that match the query parameters 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
  • Return the asset associated with this device ID. When you use this query parameter, don't combine it with other parameters.
  • Attributes
    Title: Attributes
    Additional Properties Allowed: additionalProperties
    The attributes entered in the UI, as key/value pairs.
  • Filter the items based on a case-insensitive partial match of this string with the asset'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 `label` properties.
  • 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.
  • listOfAssets
    Asset ID(s) to search for. For example `[15,16]`.
  • Filter results based on a case-insensitive partial match of this string with the asset's user-defined name.
  • 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 : listOfAssets
Type: array
Asset ID(s) to search for. For example `[15,16]`.
Show Source
Example Request (application/json)
{
    "search":"1225",
    "offset":0,
    "limit":2,
    "format":"long",
    "orderBy":"createdOn:asc",
    "attributes":{
        "EquipmentManufacturer":"Example Company"
    },
    "label":"bed"
}

Response

Supported Media Types

200 Response

The assets 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
Assets found.
Show Source
  • Asset
    Title: Asset
    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/assets` responses only.
Nested Schema : Asset
Type: object
Title: Asset
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/assets` responses only.
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 : 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 : Last Known Location
Type: object
Title: Last Known Location
Last known location of the asset.
Match One
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
Nested Schema : Beacon
Type: object
Title: Beacon
Device's identifying information.
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 : gpsPoint
Type: object
GPS point.
Show Source
Example Response (application/json)
{
    "totalResults":32,
    "offset":0,
    "limit":2,
    "count":2,
    "hasMore":true,
    "items":[
        {
            "modifiedOn":"2015-08-06T18:37:59.424Z",
            "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/3401"
                        },
                        {
                            "rel":"self",
                            "href":"/mobile/platform/location/devices/3401"
                        }
                    ],
                    "attributes":{
                        "visibility":"Public",
                        "manufacturerId":"10D39AE7-020E-4467-9CB2-DD36366F899D",
                        "manufacturer":"Abc Company",
                        "status":"Active"
                    },
                    "id":3401,
                    "createdOn":"2015-08-06T18:37:59.424Z"
                }
            ],
            "createdBy":"jdoe",
            "lastKnownLocation":{
                "placeId":244
            },
            "name":"hospital bed #233",
            "description":"model 1225 hospital bed",
            "modifiedBy":"jdoe",
            "links":[
                {
                    "rel":"canonical",
                    "href":"/mobile/platform/location/assets/333"
                },
                {
                    "rel":"self",
                    "href":"/mobile/platform/location/assets/333"
                }
            ],
            "attributes":{
                "SJId":"6754843090",
                "EquipmentManufacturer":"Example Company"
            },
            "label":"hospital bed",
            "id":333,
            "createdOn":"2015-08-06T18:37:59.424Z"
        },
        {
            "modifiedOn":"2015-10-16T09:24:41.354Z",
            "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/648"
                        },
                        {
                            "rel":"self",
                            "href":"/mobile/platform/location/devices/648"
                        }
                    ],
                    "attributes":{
                        "visibility":"Public",
                        "manufacturerId":"10D39AE7-020E-4467-9CB2-DD36366F899D",
                        "manufacturer":"Abc Company",
                        "status":"Active"
                    },
                    "id":648,
                    "createdOn":"2015-08-06T18:37:59.424Z"
                }
            ],
            "createdBy":"jdoe",
            "lastKnownLocation":{
                "placeId":360
            },
            "name":"hospital bed #233",
            "description":"model 1225 hospital bed",
            "modifiedBy":"jdoe",
            "links":[
                {
                    "rel":"canonical",
                    "href":"/mobile/platform/location/assets/888"
                },
                {
                    "rel":"self",
                    "href":"/mobile/platform/location/assets/888"
                }
            ],
            "attributes":{
                "SJId":"6754843090",
                "EquipmentManufacturer":"Example Company"
            },
            "label":"hospital bed",
            "id":888,
            "createdOn":"2015-10-16T09:24:41.354Z"
        }
    ]
}

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 assets by submitting a POST request on the REST resource.

curl -i \
-X POST \ 
-u mobile.user@example.com:password \
-d @assets.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/assets/query

Example of Request Body

Here's an example of the request body in JSON format. This example requests, in ascending createdOn order, information about assets where the label includes the string bed, the EquipmentManufacturer attribute is Example Company, and either the name or description contains the string 1225 (case-insensitive matches). This request asks for the first two search results. If you subsequently want to get the next set of assets, starting with the third asset, you would send another request with the offset set to 2. Note that it's 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":"bed",
    "attributes":{
        "EquipmentManufacturer":"Example Company"
    },
    "orderBy":"createdOn:asc",
    "offset":0,
    "limit":2,
    "format":"long",
    "search":"1225"
}

Example of Response Header

Here's an example of the response header:

200 OK
Content-Length: 1081
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:

{
    "items":[
        {
            "devices":[
                {
                    "id":3401,
                    "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/3401"},
                        {
                            "rel":"self",
                            "href":"/mobile/platform/location/devices/3401"}
                    ],
                    "attributes":{
                        "manufacturer":"Example Company",
                        "manufacturerId":"10D39AE7-020E-4467-9CB2-DD36366F899D",
                        "status":"Active",
                        "visibility":"Public"},
                    "description":"Beacon on 1st Floor in FixitFast Warehouse in Redwood City"}
            ],
            "label":"hospital bed",
            "lastKnownLocation":{
                "placeId":244},
            "id":333,
            "createdBy":"jdoe",
            "name":"hospital bed #233",
            "createdOn":"2015-08-06T18:37:59.424Z",
            "modifiedOn":"2015-08-06T18:37:59.424Z",
            "modifiedBy":"jdoe",
            "links":[
                {
                    "rel":"canonical",
                    "href":"/mobile/platform/location/assets/333"},
                {
                    "rel":"self",
                    "href":"/mobile/platform/location/assets/333"}
            ],
            "attributes":{
                "EquipmentManufacturer":"Example Company",
                "SJId":"6754843090"},
            "description":"model 1225 hospital bed"},
        {
            "devices":[
                {
                    "id":648,
                    "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/648"},
                        {
                            "rel":"self",
                            "href":"/mobile/platform/location/devices/648"}
                    ],
                    "attributes":{
                        "manufacturer":"Example Company",
                        "manufacturerId":"10D39AE7-020E-4467-9CB2-DD36366F899D",
                        "status":"Active",
                        "visibility":"Public"},
                    "description":"Beacon on 1st Floor in FixitFast Warehouse in Redwood City"}
            ],
            "label":"hospital bed",
            "lastKnownLocation":{
                "placeId":360},
            "id":888,
            "createdBy":"jdoe",
            "name":"hospital bed #233",
            "createdOn":"2015-10-16T09:24:41.354Z",
            "modifiedOn":"2015-10-16T09:24:41.354Z",
            "modifiedBy":"jdoe",
            "links":[
                {
                    "rel":"canonical",
                    "href":"/mobile/platform/location/assets/888"},
                {
                    "rel":"self",
                    "href":"/mobile/platform/location/assets/888"}
            ],
            "attributes":{
                "EquipmentManufacturer":"Example Company",
                "SJId":"6754843090"},
            "description":"model 1225 hospital bed"}
    ],
    "totalResults":32,
    "offset":0,
    "limit":2,
    "count":2,
    "hasMore":true
}