Return Assets by Query
/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
- application/json
object
Query Parameters
-
associatedDeviceId:
integer
Return the asset associated with this device ID. When you use this query parameter, don't combine it with other parameters.
-
attributes:
object Attributes
Title:
Attributes
Additional Properties Allowed: additionalPropertiesThe attributes entered in the UI, as key/value pairs. -
description:
string
Filter the items based on a case-insensitive partial match of this string with the asset's description.
-
format:
string
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. -
label:
string
Filter results based on a partial match of this string with the label.
-
limit:
integer
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:
array listOfAssets
Asset ID(s) to search for. For example `[15,16]`.
-
name:
string
Filter results based on a case-insensitive partial match of this string with the asset's user-defined name.
-
offset:
integer
Default Value:
0
Zero-based index of the first item to return. -
orderBy:
string
Allowed Values:
[ "name", "label", "createdOn", "modifiedOn" ]
Field to order results by. Requires either `:asc` for ascending or `:desc` for descending. Example: `createdOn:asc`. -
search:
string
Filter results based on a case-insensitive partial match of this string with either the asset's name or description.
object
Attributes
array
{
"search":"1225",
"offset":0,
"limit":2,
"format":"long",
"orderBy":"createdOn:asc",
"attributes":{
"EquipmentManufacturer":"Example Company"
},
"label":"bed"
}
Response
- application/json
200 Response
object
Query Results
-
count:
integer
Number of items in this response.
-
hasMore:
boolean
`true` if there are more items to return.
-
items:
array items
Minimum Number of Items:
1
Assets found. -
limit:
integer
Limit requested.
-
offset:
integer
Offset (starting index) requested for this response.
-
totalResults:
integer
Number of items that match the query.
array
1
-
[0]:
object 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.
object
Asset
-
attributes:
object Attributes
Title:
Attributes
Additional Properties Allowed: additionalPropertiesThe attributes entered in the UI, as key/value pairs. -
createdBy:
string
User who added the asset.
-
createdOn:
string
When the asset was added.
-
description:
string
Asset's description.
-
devices:
array devices
Minimum Number of Items:
0
Devices associated with this asset. Typically one device, but there can be multiple devices. -
id:
number
Asset's ID.
-
label:
string
Asset's label.
-
lastKnownPlace:
object Last Known Location
Title:
Last Known Location
Last known location of the asset. -
links:
array Relationship links
Title:
Relationship links
Minimum Number of Items:1
Unique Items Required:true
-
modifiedBy:
string
User who last modified the asset.
-
modifiedOn:
string
When the asset was last modified.
-
name:
string
User-defined name for the asset.
object
Attributes
array
0
-
[0]:
object 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.
object
Last Known Location
array
Relationship links
1
true
-
[0]:
object Link
Title:
Link
object
Associated Location Device
-
attributes:
object Attributes
Title:
Attributes
Additional Properties Allowed: additionalPropertiesThe attributes entered in the UI, as key/value pairs. -
beacon:
object Beacon
Title:
Beacon
Device's identifying information. -
createdBy:
string
User who added the device.
-
createdOn:
string
When the device was added.
-
description:
string
Device's description.
-
id:
number
Device's ID.
-
links:
array Relationship links
Title:
Relationship links
Minimum Number of Items:1
Unique Items Required:true
-
modifiedBy:
string
User who last modified the device.
-
modifiedOn:
string
When the device was last modified.
-
name:
string
User-defined name for the device.
object
Beacon
object
-
major:
string
Device's major version number.
-
minor:
string
Device's minor version number.
-
uuid:
string
Device's UUID.
object
-
id1:
string
Device's first ID.
-
id2:
string
Device's second ID.
-
id3:
string
Device's third ID.
object
-
eddystoneUid:
object eddystoneUid
Device's UID.
-
eddystoneUrl:
object eddystoneUrl
Device's URL.
object
-
instance:
string
Individual device's ID.
-
namespace:
string
Namespace that the device is a member of.
object
-
latitude:
number
GPS point's latitude
-
longitude:
number
GPS point's longitude.
object
Link
-
href:
string
A relative URL.
-
rel:
Allowed Values:
[ "self", "canonical", "prev", "next" ]
The type of link.
{
"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.
object
Error
-
detail:
string
Message that provides the error details.
-
o:ecid:
string
Execution context ID, which is a unique identifier to correlate events or requests that are associated with the same transaction across several components.
-
o:errorCode:
string
The service's error code.
-
o:errorDetails:
array o:errorDetails
Minimum Number of Items:
0
Included when the error is caused by multiple issues. -
o:errorPath:
string
The relative point in the API path where the error occurred.
-
status:
integer
HTTP status code. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for more details.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
array
0
-
[0]:
object Error Detail
Title:
Error Detail
object
Error Detail
-
instance:
string
URI to the link that provides more detailed information about the error.
-
o:errorCode:
string
The service's error code.
-
o:errorPath:
string
The relative point in the API path where the error occurred.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
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
}