Update Asset
/mobile/system/locationManagement/assets/{id}
Updates the asset that matches the ID.
Permissions
Only team members with the Administrator
role can access the Location Management API.
Request
- application/json
-
id: integer
The ID of the asset. This ID must be an existing asset ID.
object
Update Asset
-
attributes(optional):
object Attributes
Title:
Attributes
Additional Properties Allowed: additionalPropertiesThe attributes entered in the UI, as key/value pairs. -
description(optional):
string
Asset's description.
-
devices(optional):
array devices
Minimum Number of Items:
0
IDs of devices that are associated with this asset. Typically one device ID, but there can be multiple associated devices. -
label(optional):
string
Asset's label.
-
lastKnownLocation(optional):
object Last Known Location
Title:
Last Known Location
Last known location of the asset. -
name(optional):
string
User-defined name for the asset. Must be unique.
object
Attributes
array
0
object
Last Known Location
object
-
latitude(optional):
number
GPS point's latitude
-
longitude(optional):
number
GPS point's longitude.
{
"devices":[
1435
],
"lastKnownLocation":{
"gpsPoint":{
"latitude":37.5548,
"longitude":-121.1566
}
}
}
Response
- application/json
200 Response
object
Asset
-
attributes(optional):
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(optional):
array devices
Minimum Number of Items:
0
The devices that are associated with this asset. Typically one device, but there can be multiple associated devices. -
id:
number
Asset's ID.
-
label(optional):
string
Asset's label.
-
lastKnownLocation(optional):
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(optional):
string
User who last modified the asset.
-
modifiedOn(optional):
string
When the asset was last modified.
-
name:
string
User-defined name for the asset.
object
Attributes
array
0
-
Array of:
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
-
Array of:
object Link
Title:
Link
object
Associated Location Device
-
attributes(optional):
object Attributes
Title:
Attributes
Additional Properties Allowed: additionalPropertiesThe attributes entered in the UI, as key/value pairs. -
beacon(optional):
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(optional):
string
User who last modified the device.
-
modifiedOn(optional):
string
When the device was last modified.
-
name:
string
User-defined name for the device.
object
Beacon
object
-
major(optional):
string
Device's major version number.
-
minor(optional):
string
Device's minor version number.
-
uuid(optional):
string
Device's UUID.
object
-
id1(optional):
string
Device's first ID.
-
id2(optional):
string
Device's second ID.
-
id3(optional):
string
Device's third ID.
object
-
eddystoneUid(optional):
object eddystoneUid
Device's UID.
-
eddystoneUrl(optional):
object eddystoneUrl
Device's URL.
object
-
instance(optional):
string
Individual device's ID.
-
namespace(optional):
string
Namespace that the device is a member of.
object
-
latitude(optional):
number
GPS point's latitude
-
longitude(optional):
number
GPS point's longitude.
object
Link
-
href:
string
A relative URL.
-
rel:
Allowed Values:
[ "self", "canonical", "prev", "next" ]
The type of link.
{
"modifiedOn":"2015-08-06T18:37:59.424Z",
"devices":[
{
"modifiedOn":"2016-03-03T21:31:28.836+0000",
"beacon":{
"altBeacon":{
"id2":"AFF9",
"id1":"B9407F30-F5F8-466E",
"id3":"25556B57FE6D"
}
},
"createdBy":"bsmith",
"name":"RC_WH_01_F01_B006",
"description":"Beacon on 2nd Floor in FixitFast Warehouse in Redwood City",
"modifiedBy":"bsmith",
"links":[
{
"rel":"canonical",
"href":"/mobile/platform/location/devices/1435"
},
{
"rel":"self",
"href":"/mobile/platform/location/devices/1435"
}
],
"id":1435,
"createdOn":"2016-03-03T21:31:28.836+0000",
"properties":{
"manufacturerId":"10D39AE7-020E-4467-9CB2-DD36366F899D",
"mac":"7C-7A-91-E2-A9-7D",
"manufacturer":"RadiusNetworks",
"status":"Active"
}
}
],
"createdBy":"jdoe",
"lastKnownLocation":{
"gpsPoint":{
"latitude":37.5548,
"longitude":-121.1566
}
},
"name":"RC_WH_01_F01_B023",
"description":"Beacon #23 in the FixItFast Warehouse in Redwood City",
"modifiedBy":"jdoe",
"links":[
{
"rel":"canonical",
"href":"/mobile/platform/location/assets/111"
},
{
"rel":"self",
"href":"/mobile/platform/location/assets/111"
}
],
"label":"beacon",
"id":111,
"createdOn":"2015-08-06T18:37:59.424Z",
"properties":{
"beaconID":"AE2924505-66045",
"EquipmentManufacturer":"Radius Networks"
}
}
400 Response
Bad request.
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(optional):
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
-
Array of:
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.
404 Response
Asset ID not found.
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(optional):
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
-
Array of:
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
The following example shows how to update an asset by submitting a PUT request on the REST resource using cURL. For more information about cURL, see Use cURL.
curl -i -X PUT -u administrator@example.com:password -d update.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/system/locationManagement/assets/32
Example of Request Body
The following example shows the contents of the request body. This example associates the asset with a device.
{ "devices": [32] }
Example of Response Header
The following shows an example of the response header.
200 OK Content-Length: 911 Content-Type: application/json Date: Fri, 22 Sep 2017 00:08:29 GMT
Example of Response Body
The following example shows, in JSON format, the contents of the response body, which now includes the associated device:
{
"id": 32,
"createdOn": "2017-09-19T21:48:21.173Z",
"createdBy": "administrator",
"modifiedOn": "2017-09-22T00:08:30.080Z",
"modifiedBy": "administrator",
"name": "exc15",
"label": "Excavator #15",
"description": "Hydraulic excavator",
"lastKnownLocation": null,
"devices": [
{
"id": 32,
"createdOn": "2017-09-21T23:29:41.903Z",
"createdBy": "administrator",
"modifiedOn": "2017-09-21T23:29:41.903Z",
"modifiedBy": "administrator",
"name": "RC_WH_01_F01_B002",
"description": "iBeacon",
"beacon": {
"iBeacon": {
"major": "1.0",
"minor": "1.1",
"uuid": "B9407F30-F5F8-466E-AFF9-25556B57AB1D"
}
},
"attributes": {
"status": "Available",
"manufacturer": "Gimbal"
},
"links": [
{
"rel": "canonical",
"href": "/mobile/platform/location/devices/32"
},
{
"rel": "self",
"href": "/mobile/platform/location/devices/32"
}
]
}
],
"attributes": {
"cylinders": "4",
"serial number": "13A3168G"
},
"links": [
{
"rel": "canonical",
"href": "/mobile/platform/location/assets/32"
},
{
"rel": "self",
"href": "/mobile/platform/location/assets/32"
}
]
}