Add Assets from File

post

/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

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

Response

Supported Media Types

200 Response

The location assets were created successfully.
Body ()
Root Schema : Asset Items Array
Type: object
Title: Asset Items Array
Show Source
Nested Schema : items
Type: array
Minimum Number of Items: 1
Array of the created assets.
Show Source
Nested Schema : Asset
Type: object
Title: Asset
The created or updated asset.
Show Source
Nested Schema : Attributes
Type: object
Title: Attributes
Additional Properties Allowed
Show Source
The attributes entered in the UI, as key/value pairs.
Show Source
Nested Schema : devices
Type: array
Minimum Number of Items: 0
The devices that are associated with this asset. Typically one device, but there can be multiple associated devices.
Show Source
  • 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.
Nested Schema : Last Known Location
Type: object
Title: Last Known Location
Last known location of the asset.
Match One
Show Source
Nested Schema : Associated Location Device
Type: object
Title: Associated Location Device
The properties for an associated location device. Note that this object doesn't contain the `asset` and `place` properties.
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
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 : gpsPoint
Type: object
GPS point.
Show Source
Example Response (application/json)
{
    "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.

Body ()
Root Schema : Error
Type: object
Title: Error
The error JSON object returned by the 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

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=3000lbs

Example 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"
        }
      ]
    }
  ]
}