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 mobile user, then you must be a member of the realm that's associated with the mobile backend.

Request

Supported Media Types
Body ()
Root Schema : Query Parameters
Type: object
Title: Query Parameters
Show Source
Nested Schema : Attributes
Type: object
Title: Attributes
Additional Properties Allowed
Show Source
The attributes entered in the MCS 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)
{
    "limit":2,
    "orderBy":"createdOn:asc",
    "search":"1225",
    "label":"bed",
    "attributes":{
        "EquipmentManufacturer":"Example Company"
    },
    "format":"long",
    "offset":0
}
Back to Top

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

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 Mobile Cloud 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
Back to Top

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 ascendingcreatedOn 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 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":"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
}
Back to Top