Add Devices
post
/mobile/system/locationManagement/devices
Creates one or more devices.
Permissions
Only team members with the MobileEnvironment_System
role can access the Location Management API.
Request
Supported Media Types
- application/json
Root Schema : Device Items Array
Type:
object
Title:
Show Source
Device Items Array
-
items(optional):
array items
Minimum Number of Items:
1
Array of the devices to be created.
Nested Schema : items
Type:
array
Minimum Number of Items:
1
Array of the devices to be created.
Show Source
-
Array of:
object Create Location Device
Title:
Create Location Device
The device to be created.
Nested Schema : Create Location Device
Type:
object
Title:
Create Location Device
The device to be created.
Show Source
-
asset(optional):
number
The asset ID that contains the device. A device can be associated with a place or asset, but not both.
-
attributes(optional):
object Attributes
Title:
Attributes
Additional Properties Allowed: additionalPropertiesThe attributes entered in the MCS UI, as key/value pairs. -
beacon:
object Beacon
Title:
Beacon
Device's identifying information. -
description(optional):
string
Device's description.
-
name:
string
User-defined name for the device.
-
place(optional):
number
The place ID that contains the device. A device can be associated with a place or asset, but not both.
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 : Beacon
Type:
object
Title:
Beacon
Device's identifying information.
Match One
Show Source
Nested Schema : iBeacon
Type:
object
iBeacon device.
Show Source
-
major(optional):
string
Device's major version number.
-
minor(optional):
string
Device's minor version number.
-
uuid(optional):
string
Device's UUID.
Nested Schema : altBeacon
Type:
object
AltBeacon device.
Show Source
-
id1(optional):
string
Device's first ID.
-
id2(optional):
string
Device's second ID.
-
id3(optional):
string
Device's third ID.
Nested Schema : eddystone
Type:
object
Eddystone device.
Show Source
-
eddystoneUid(optional):
object eddystoneUid
Device's UID.
-
eddystoneUrl(optional):
object eddystoneUrl
Device's URL.
Nested Schema : eddystoneUid
Type:
object
Device's UID.
Show Source
-
instance(optional):
string
Individual device's ID.
-
namespace(optional):
string
Namespace that the device is a member of.
Example Request (application/json)
{
"items":[
{
"asset":333,
"description":"Beacon on 2nd Floor in FixitFast Warehouse in Redwood City",
"name":"RC_WH_01_F01_B006",
"beacon":{
"altBeacon":{
"id2":"AFF9",
"id1":"B9407F30-F5F8-466E",
"id3":"25556B57FE6D"
}
},
"attributes":{
"manufacturerId":"10D39AE7-020E-4467-9CB2-DD36366F899D",
"status":"Active",
"visibility":"Public",
"manufacturer":"Abc Company"
}
},
{
"description":"Beacon on 1st Floor in FixitFast Warehouse in Redwood City",
"name":"RC_WH_01_F01_B001",
"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"
},
"place":111
}
]
}
Response
Supported Media Types
- application/json
200 Response
The location devices were created successfully.
Root Schema : Devices Array
Type:
object
Title:
Show Source
Devices Array
-
items(optional):
array items
Minimum Number of Items:
1
Array of the created devices.
Nested Schema : items
Type:
array
Minimum Number of Items:
1
Array of the created devices.
Show Source
-
Array of:
object Location Device
Title:
Location Device
The created or updated device.
Nested Schema : Location Device
Type:
object
Title:
Location Device
The created or updated device.
Show Source
-
asset(optional):
object Associated Asset
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. -
attributes(optional):
object Attributes
Title:
Attributes
Additional Properties Allowed: additionalPropertiesThe attributes entered in the MCS 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 to MCS.
-
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.
-
place(optional):
object Associated Place
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.
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
-
attributes(optional):
object Attributes
Title:
Attributes
Additional Properties Allowed: additionalPropertiesThe attributes entered in the MCS UI, as key/value pairs. -
createdBy:
string
User who added the asset.
-
createdOn:
string
When the asset was added to MCS.
-
description:
string
Asset's description.
-
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.
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 : Beacon
Type:
object
Title:
Beacon
Device's identifying information.
Match One
Show Source
Nested Schema : Relationship links
Type:
array
Title:
Relationship links
Minimum Number of Items:
1
Unique Items Required:
Show Source
true
-
Array of:
object Link
Title:
Link
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
-
address(optional):
object Place's Address
Title:
Place's Address
GPS address of the place. -
attributes(optional):
object Attributes
Title:
Attributes
Additional Properties Allowed: additionalPropertiesThe attributes entered in the MCS UI, as key/value pairs. -
createdBy:
string
User who added the place.
-
createdOn:
string
When the place was added to MCS.
-
description:
string
Place's description.
-
hasChildren(optional):
boolean
Set to `true` if this place is a parent of other places.
-
id:
number
Place's ID.
-
label(optional):
string
Place's label.
-
links:
array Relationship links
Title:
Relationship links
Minimum Number of Items:1
Unique Items Required:true
-
modifiedBy(optional):
string
User who last modified the place.
-
modifiedOn(optional):
string
When the place was last modified.
-
name:
string
User-defined name for the place.
-
parentPlace(optional):
number
Place's parent place.
Nested Schema : Last Known Location
Type:
object
Title:
Last Known Location
Last known location of the asset.
Match One
Show Source
Nested Schema : gpsPoint
Type:
object
GPS point.
Show Source
-
latitude(optional):
number
GPS point's latitude
-
longitude(optional):
number
GPS point's longitude.
Nested Schema : iBeacon
Type:
object
iBeacon device.
Show Source
-
major(optional):
string
Device's major version number.
-
minor(optional):
string
Device's minor version number.
-
uuid(optional):
string
Device's UUID.
Nested Schema : altBeacon
Type:
object
AltBeacon device.
Show Source
-
id1(optional):
string
Device's first ID.
-
id2(optional):
string
Device's second ID.
-
id3(optional):
string
Device's third ID.
Nested Schema : eddystone
Type:
object
Eddystone device.
Show Source
-
eddystoneUid(optional):
object eddystoneUid
Device's UID.
-
eddystoneUrl(optional):
object eddystoneUrl
Device's URL.
Nested Schema : eddystoneUid
Type:
object
Device's UID.
Show Source
-
instance(optional):
string
Individual device's ID.
-
namespace(optional):
string
Namespace that the device is a member of.
Nested Schema : Link
Type:
object
Title:
Show Source
Link
-
href:
string
A relative URL.
-
rel:
Allowed Values:
[ "self", "canonical", "prev", "next" ]
The type of link.
Nested Schema : Place's Address
Type:
object
Title:
Place's Address
GPS address of the place.
Match One
Show Source
Nested Schema : gpsCircle
Type:
object
GPS circle.
Show Source
-
latitude(optional):
number
Latitude of the center of the GPS circle.
-
longitude(optional):
number
Longitude of the center of the GPS circle.
-
radius(optional):
number
GPS circle's radius in meters.
Nested Schema : gpsPolygon
Type:
object
GPS polygon.
Show Source
-
vertices(optional):
array vertices
Minimum Number of Items:
1
GPS polygon's vertices.
Nested Schema : vertices
Type:
array
Minimum Number of Items:
1
GPS polygon's vertices.
Show Source
-
Array of:
object latitudeLongitudePair
Pair of latitude and longitude values for a place.
Nested Schema : latitudeLongitudePair
Type:
object
Pair of latitude and longitude values for a place.
Show Source
-
latitude(optional):
number
Place's latitude.
-
longitude(optional):
number
Place's longitude.
Example Response (application/json)
{
"items":[
{
"id":11111,
"createdOn":"2015-08-06T18:37:59.424Z",
"modifiedOn":"2015-08-08T07:22:44.654Z",
"asset":{
"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"
}
},
"createdBy":"jdoe",
"modifiedBy":"tsmith",
"description":"Beacon on hospital bed #233 in City Hospital",
"name":"RC_WH_01_F01_B006",
"links":[
{
"rel":"canonical",
"href":"/mobile/platform/location/devices/11111"
},
{
"rel":"self",
"href":"/mobile/platform/location/devices/11111"
}
],
"beacon":{
"altBeacon":{
"id2":"AFF9",
"id1":"B9407F30-F5F8-466E",
"id3":"25556B57FE6D"
}
},
"attributes":{
"manufacturerId":"10D39AE7-020E-4467-9CB2-DD36366F899D",
"status":"Active",
"visibility":"Public",
"manufacturer":"Abc Company"
}
},
{
"id":12345,
"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/12345"
},
{
"rel":"self",
"href":"/mobile/platform/location/devices/12345"
}
],
"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"
},
"place":{
"id":111,
"createdOn":"2015-08-06T18:37:59.424Z",
"modifiedOn":"2015-08-06T18:37:59.424Z",
"createdBy":"jdoe",
"address":{
"gpsPoint":{
"longitude":-121.1566,
"latitude":37.5548
}
},
"modifiedBy":"jdoe",
"description":"FixitFast Warehouse in Redwood City",
"name":"FixitFast Redwood City Warehouse",
"label":"FixitFast Warehouse",
"links":[
{
"rel":"canonical",
"href":"/mobile/platform/location/places/111"
},
{
"rel":"self",
"href":"/mobile/platform/location/places/111"
}
],
"attributes":{
"equipmentManufacturer":"Abc Corp"
},
"parentPlace":42
}
}
]
}
400 Response
Bad request.
Root Schema : Error
Type:
object
Title:
Error
The error JSON object returned by Mobile Cloud Service.
Show Source
-
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
Mobile Cloud Service error code.
-
o:errorDetails(optional):
array o:errorDetails
Minimum Number of Items:
0
List of the issues that cause the error. 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.
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
-
Array of:
object Error Detail
Title:
Error Detail
Nested Schema : Error Detail
Type:
object
Title:
Show Source
Error Detail
-
instance:
string
The URI to the link that provides more detailed information about the error.
-
o:errorCode:
string
Mobile Cloud Service 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 create devices by submitting a POST request on the REST resource.
curl -i \ -X POST \ -u administrator@example.com:mypassword \ -d @devices.json \ -H "Content-Type: application/json; charset=utf-8" \ -H "Oracle-Mobile-Backend-ID: ABCD9278-091f-41aa-9cb2-184bd0586fce" \ http://fif.cloud.oracle.com/mobile/system/locationManagement/devices
Examples of Request Body
Here's an example of the request body.
{
"items" : [
{
"name": "RC_WH_01_F01_B001",
"description": "Forklift beacon",
"beacon": {
"iBeacon" : {
"uid": "B9407F30-F5F8-466E-AFF9-25556B57FE6D",
"major": "1.0",
"minor": "1.1"
}
},
"properties" : {
"manufacturer": "Gimbal",
"manufacturerId": "10D39AE7-020E-4467-9CB2-DD36366F899D",
"status": "Active",
"visibility": "Public"
}
}
]
}
Example of Response Header
Here's an example of the response header:
200 OK Content-Length: 569 Content-Type: application/json Date: Tue, 19 Sep 2017 21:48:18 GMT
Example of Response Body
Here's an example of the response body:
{
"items": [
{
"id": 33,
"createdOn": "2017-09-21T23:34:11.526Z",
"createdBy": "administrator",
"modifiedOn": "2017-09-21T23:34:11.526Z",
"modifiedBy": "administrator",
"name": "RC_WH_01_F01_B001",
"description": "Forklift beacon",
"beacon": {
"iBeacon": {
"major": "1.0",
"minor": "1.1",
"uuid": "B9407F30-F5F8-466E-AFF9-25556B57FE6D"
}
},
"attributes": {
"manufacturer": "Gimbal",
"manufacturerId": "10D39AE7-020E-4467-9CB2-DD36366F899D",
"status": "Active",
"visibility": "Public"
},
"links": [
{
"rel": "canonical",
"href": "/mobile/platform/location/devices/33"
},
{
"rel": "self",
"href": "/mobile/platform/location/devices/33"
}
]
}
]
}