Add Devices from File

post

/mobile/system/locationManagement/devices/upload

Adds the devices that are defined in a file in CSV format.

The CSV format is:

name,description,uuid,major,minor,id1,id2,id3,namespace,instance,url,attributeKey1=attributeValue1,attributeKey2=attributeValue2

The attributeKey=attributeValue value is optional, and you can have multiple attributeKey=attributeValue values separated by a , (comma).

For example:

#version=1.0
RC_WH_01_F01_B001,Beacon on 1st Floor in FixitFast Warehouse in Redwood City,B9407F30-F5F8-466E-AFF9-25556B57FE6D,1.0,1.1,,,,,,,manufacturer=Abc Company,manufacturerId=10D39AE7-020E-4467-9CB2-DD36366F899D,visibility=Public,status=Active
RC_WH_01_F01_B006,Beacon on hospital bed #233 in City Hospital,,,,B9407F30-F5F8-466E,AFF9,25556B57FE6D,,,,manufacturer=Abc Company,manufacturerId=10D39AE7-020E-4467-9CB2-DD36366F899D,visibility=Public,status=Active
RC_WH_01_F01_B005,Beacon in Warehouse #7 sector2,,,,,,,B9407F30-F5F8-466E-AFF9,ASDFAF,http://www.FixitFast.com,manufacturer=Abc Company,manufacturerId=10D39AE7-020E-4467-9CB2-DD36366F899D,visibility=Public,status=Active

Permissions

Only team members with the MobileEnvironment_System role can access the Location Management API.

Request

Supported Media Types
Body ()
A body of type:
  • binary/octet-stream
Root Schema : schema
Back to Top

Response

Supported Media Types

200 Response

The location devices were created successfully.
Body ()
Root Schema : Devices Array
Type: object
Title: Devices Array
Show Source
Nested Schema : items
Type: array
Minimum Number of Items: 1
Array of the created devices.
Show Source
Nested Schema : Location Device
Type: object
Title: Location Device
The created or updated device.
Show Source
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
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 : 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
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
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 : 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
Nested Schema : gpsPolygon
Type: object
GPS polygon.
Show Source
Nested Schema : vertices
Type: array
Minimum Number of Items: 1
GPS polygon's vertices.
Show Source
Nested Schema : latitudeLongitudePair
Type: object
Pair of latitude and longitude values for a place.
Show Source
Example Response (application/json)
{
    "items":[
        {
            "id":11111,
            "createdOn":"2015-08-06T18:37:59.300Z",
            "modifiedOn":"2015-08-08T07:37:59.300Z",
            "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.362Z",
            "modifiedOn":"2015-08-08T07:37:59.362Z",
            "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"
            }
        },
        {
            "id":12346,
            "createdOn":"2015-08-06T18:37:59.433Z",
            "modifiedOn":"2015-08-08T07:37:59.433Z",
            "createdBy":"jdoe",
            "modifiedBy":"tsmith",
            "description":"Beacon in Warehouse #7 sector2",
            "name":"RC_WH_01_F01_B005",
            "links":[
                {
                    "rel":"canonical",
                    "href":"/mobile/platform/location/devices/12346"
                },
                {
                    "rel":"self",
                    "href":"/mobile/platform/location/devices/12346"
                }
            ],
            "beacon":{
                "eddystone":{
                    "eddystoneUrl":{
                        "url":"http://www.FixitFast.com"
                    },
                    "eddystoneUid":{
                        "instance":"ASDFAF",
                        "namespace":"B9407F30-F5F8-466E-AFF9"
                    }
                }
            },
            "attributes":{
                "manufacturerId":"10D39AE7-020E-4467-9CB2-DD36366F899D",
                "status":"Active",
                "visibility":"Public",
                "manufacturer":"Abc Company"
            }
        }
    ]
}

400 Response

Bad request.

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

The following example shows how to create devices from a CSV file by submitting a POST request on the REST resource using cURL. For more information about cURL, see Use cURL.

curl -i
-X POST 
-u administrator@example.com:mypassword
--data-binary @devices.csv
-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/upload 

Examples of Request Body

The following shows an example of the upload file.

#version=1.0
RC_WH_01_F01_B002,iBeacon,B9407F30-F5F8-466E-AFF9-25556B57AB1D,1.0,1.1,,,,,,,manufacturer=Gimbal,status=Available

Example of Response Header

The following shows an example of the response header:

200 OK
Content-Length: 486
Content-Type: application/json
Date: Tue, 19 Sep 2017 21:48:18 GMT

Example of Response Body

The following example shows the contents of the response body in JSON format:

{
    "items": [
        {
            "id": 31,
            "createdOn": "2017-09-21T23:16:53.331Z",
            "createdBy": "administrator",
            "modifiedOn": "2017-09-21T23:16:53.331Z",
            "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": {
                "manufacturer": "Gimbal",
                "status": "Available"
            },
            "links": [
                {
                    "rel": "canonical",
                    "href": "/mobile/platform/location/devices/31"
                },
                {
                    "rel": "self",
                    "href": "/mobile/platform/location/devices/31"
                }
            ]
        }
    ]
}
Back to Top