Add Assets from File
/mobile/system/locationManagement/assets/upload
Adds the assets that are defined in a file in CSV format.
The CSV format is:
name,description,label,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
hospital bed #233,model 1225 hospital bed,hospital bed,EquipmentManufacturer=Example Company,SJId=6754843090
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
objectAsset Items Array- 
            items: 
            array  items
            
            Minimum Number of Items:1Array of the created assets.
array1- 
            [0]: 
                object  Asset
            
            Title:AssetThe created or updated asset.
objectAsset- 
            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.
- 
            devices: 
            array  devices
            
            Minimum Number of Items:0The devices that are associated with this asset. Typically one device, but there can be multiple associated devices.
- 
            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.
objectAttributesarray0- 
            [0]: 
                object  Associated Location Device
            
            Title:Associated Location DeviceThe properties for an associated location device. Note that this object doesn't contain the `asset` and `place` properties.
objectLast Known LocationarrayRelationship links1true- 
            [0]: 
                object  Link
            
            Title:Link
objectAssociated Location Device- 
            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.
objectBeaconobject- 
            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.
objectLink- 
            href: 
            string
            A relative URL.
- 
            rel: 
            
            Allowed Values:[ "self", "canonical", "prev", "next" ]The type of link.
{
    "items":[
        {
            "modifiedOn":"2015-08-06T18:37:59.424Z",
            "createdBy":"jdoe",
            "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"
        }
    ]
}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 assets 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 @assets.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/assets/upload
Examples of Request Body
The following shows an example of the upload file.
#version=1.0
fl7,KM forklift,Forklift #7,capacity=3000lbsExample of Response Header
The following shows an example of the response header:
200 OK Content-Length: 400 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": 34,
      "createdOn": "2017-09-19T22:45:13.740Z",
      "createdBy": "administrator",
      "modifiedOn": "2017-09-19T22:45:13.740Z",
      "modifiedBy": "administrator",
      "name": "fl7",
      "label": "Forklift #7",
      "description": "KM forklift",
      "lastKnownLocation": null,
      "attributes": {
        "capacity": "3000lbs"
      },
      "links": [
        {
          "rel": "canonical",
          "href": "/mobile/platform/location/assets/34"
        },
        {
          "rel": "self",
          "href": "/mobile/platform/location/assets/34"
        }
      ]
    }
  ]
}