Add Devices from File
/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 Administrator role can access the Location Management API.
Request
- binary/octet-stream
- binary/octet-stream
Response
- application/json
200 Response
objectDevices Array- 
            items: 
            array  items
            
            Minimum Number of Items:1Array of the created devices.
array1- 
            [0]: 
                object  Location Device
            
            Title:Location DeviceThe created or updated device.
objectLocation Device- 
            asset: 
            object  Associated Asset
            
            Title:Associated AssetThe properties for an associated asset. This object doesn't include the `devices` property because the associated device is the containing object.
- 
            attributes: 
            object  Attributes
            
            Title:AttributesAdditional Properties Allowed: additionalPropertiesThe attributes entered in the UI, as key/value pairs.
- 
            beacon: 
            object  Beacon
            
            Title:BeaconDevice'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 linksMinimum Number of Items:1Unique 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.
- 
            place: 
            object  Associated Place
            
            Title:Associated PlaceThe properties for an associated place. This object doesn't include the `devices` property because the associated device is the containing object.
objectAssociated Asset- 
            attributes: 
            object  Attributes
            
            Title:AttributesAdditional 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.
- 
            id: 
            number
            Asset's ID.
- 
            label: 
            string
            Asset's label.
- 
            lastKnownLocation: 
            object  Last Known Location
            
            Title:Last Known LocationLast known location of the asset.
- 
            links: 
            array  Relationship links
            
            Title:Relationship linksMinimum Number of Items:1Unique 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.
objectAttributesobjectBeaconarrayRelationship links1true- 
            [0]: 
                object  Link
            
            Title:Link
objectAssociated Place- 
            address: 
            object  Place's Address
            
            Title:Place's AddressGPS address of the place.
- 
            attributes: 
            object  Attributes
            
            Title:AttributesAdditional Properties Allowed: additionalPropertiesThe attributes entered in the UI, as key/value pairs.
- 
            createdBy: 
            string
            User who added the place.
- 
            createdOn: 
            string
            When the place was added.
- 
            description: 
            string
            Place's description.
- 
            hasChildren: 
            boolean
            Set to `true` if this place is a parent of other places.
- 
            id: 
            number
            Place's ID.
- 
            label: 
            string
            Place's label.
- 
            links: 
            array  Relationship links
            
            Title:Relationship linksMinimum Number of Items:1Unique Items Required:true
- 
            modifiedBy: 
            string
            User who last modified the place.
- 
            modifiedOn: 
            string
            When the place was last modified.
- 
            name: 
            string
            User-defined name for the place.
- 
            parentPlace: 
            number
            Place's parent place.
objectLast Known Locationobject- 
            latitude: 
            number
            GPS point's latitude
- 
            longitude: 
            number
            GPS point's longitude.
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.
objectLink- 
            href: 
            string
            A relative URL.
- 
            rel: 
            
            Allowed Values:[ "self", "canonical", "prev", "next" ]The type of link.
objectPlace's Addressobject- 
            latitude: 
            number
            Latitude of the center of the GPS circle.
- 
            longitude: 
            number
            Longitude of the center of the GPS circle.
- 
            radius: 
            number
            GPS circle's radius in meters.
object- 
            vertices: 
            array  vertices
            
            Minimum Number of Items:1GPS polygon's vertices.
array1- 
            [0]: 
                object  latitudeLongitudePair
            
            Pair of latitude and longitude values for a place.
object- 
            latitude: 
            number
            Place's latitude.
- 
            longitude: 
            number
            Place's longitude.
{
    "items":[
        {
            "modifiedOn":"2015-08-08T07:37:59.300Z",
            "beacon":{
                "altBeacon":{
                    "id2":"AFF9",
                    "id1":"B9407F30-F5F8-466E",
                    "id3":"25556B57FE6D"
                }
            },
            "createdBy":"jdoe",
            "name":"RC_WH_01_F01_B006",
            "description":"Beacon on hospital bed #233 in City Hospital",
            "modifiedBy":"tsmith",
            "links":[
                {
                    "rel":"canonical",
                    "href":"/mobile/platform/location/devices/11111"
                },
                {
                    "rel":"self",
                    "href":"/mobile/platform/location/devices/11111"
                }
            ],
            "attributes":{
                "visibility":"Public",
                "manufacturerId":"10D39AE7-020E-4467-9CB2-DD36366F899D",
                "manufacturer":"Abc Company",
                "status":"Active"
            },
            "id":11111,
            "createdOn":"2015-08-06T18:37:59.300Z"
        },
        {
            "modifiedOn":"2015-08-08T07:37:59.362Z",
            "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/12345"
                },
                {
                    "rel":"self",
                    "href":"/mobile/platform/location/devices/12345"
                }
            ],
            "attributes":{
                "visibility":"Public",
                "manufacturerId":"10D39AE7-020E-4467-9CB2-DD36366F899D",
                "manufacturer":"Abc Company",
                "status":"Active"
            },
            "id":12345,
            "createdOn":"2015-08-06T18:37:59.362Z"
        },
        {
            "modifiedOn":"2015-08-08T07:37:59.433Z",
            "beacon":{
                "eddystone":{
                    "eddystoneUid":{
                        "instance":"ASDFAF",
                        "namespace":"B9407F30-F5F8-466E-AFF9"
                    },
                    "eddystoneUrl":{
                        "url":"http://www.FixitFast.com"
                    }
                }
            },
            "createdBy":"jdoe",
            "name":"RC_WH_01_F01_B005",
            "description":"Beacon in Warehouse #7 sector2",
            "modifiedBy":"tsmith",
            "links":[
                {
                    "rel":"canonical",
                    "href":"/mobile/platform/location/devices/12346"
                },
                {
                    "rel":"self",
                    "href":"/mobile/platform/location/devices/12346"
                }
            ],
            "attributes":{
                "visibility":"Public",
                "manufacturerId":"10D39AE7-020E-4467-9CB2-DD36366F899D",
                "manufacturer":"Abc Company",
                "status":"Active"
            },
            "id":12346,
            "createdOn":"2015-08-06T18:37:59.433Z"
        }
    ]
}400 Response
Bad request.
objectError- 
            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:0List 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.
array0- 
            [0]: 
                object  Error Detail
            
            Title:Error Detail
objectError Detail- 
            instance: 
            string
            The 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 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:password --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=AvailableExample 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"
                }
            ]
        }
    ]
}