Add Assets

post

/mobile/system/locationManagement/assets

Creates one or more location assets.

Permissions

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

Request

Supported Media Types
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 assets to be created.
Show Source
Nested Schema : Create Asset
Type: object
Title: Create Asset
The asset to be created.
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
IDs of devices that are associated with this asset. Typically one device ID, but there can be multiple associated devices.
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
Example Request (application/json)
{
    "items":[
        {
            "devices":[
                1111
            ],
            "lastKnownLocation":{
                "placeId":244
            },
            "name":"hospital bed #233",
            "description":"model 1225 hospital bed",
            "attributes":{
                "SJId":"6754843090",
                "EquipmentManufacturer":"Example Company"
            },
            "label":"hospital bed"
        }
    ]
}

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",
            "devices":[
                {
                    "modifiedOn":"2015-08-08T07:22:44.654Z",
                    "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/3401"
                        },
                        {
                            "rel":"self",
                            "href":"/mobile/platform/location/devices/3401"
                        }
                    ],
                    "attributes":{
                        "visibility":"Public",
                        "manufacturerId":"10D39AE7-020E-4467-9CB2-DD36366F899D",
                        "manufacturer":"Abc Company",
                        "status":"Active"
                    },
                    "id":3401,
                    "createdOn":"2015-08-06T18:37:59.424Z"
                }
            ],
            "createdBy":"jdoe",
            "lastKnownLocation":{
                "placeId":244
            },
            "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 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
-d @assets.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/assets

Examples of Request Body

The following shows an example of the request body.

{
  "items": [
        {
            "name": "fl6",
            "label": "Forklift #6",
            "description": "KM forklift",
            "lastKnownLocation" : null,
            "properties" : {
                "serial number": "OU812-9845873",
                "capacity": "3000lbs"
            }
        },
        {
            "name": "gen233",
            "label": "Generator #233",
            "description": "Portable inverter generator",
            "lastKnownLocation" : null,
            "properties" : {
                "serial number": "6754843090",
                "watts":"1600"
            }
        },
        {
            "name": "exc15",
            "label": "Excavator #15",
            "description": "Hydraulic excavator",
            "lastKnownLocation" : null,
            "properties" : {
                "serial number": "13A3168G",
                "cylinders":"4"
            }
        },
        {
            "name": "wd23",
            "label": "Waste dumpster #23",
            "description": "DR 40 yd dumpster",
            "lastKnownLocation" : null,
            "properties" : {
                "serial number": "mx58sk",
                "capacity": "40 yd",
                "height": "3.5 ft"
            }
        }
    ]
}

Example of Response Header

The following shows an example of the response header:

200 OK
Content-Length: 1733
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": 30,
      "createdOn": "2017-09-19T21:48:21.145Z",
      "createdBy": "administrator",
      "modifiedOn": "2017-09-19T21:48:21.145Z",
      "modifiedBy": "administrator",
      "name": "fl6",
      "label": "Forklift #6",
      "description": "KM forklift",
      "lastKnownLocation": null,
      "attributes": {
        "capacity": "3000lbs",
        "serial number": "OU812-9845873"
      },
      "links": [
        {
          "rel": "canonical",
          "href": "/mobile/platform/location/assets/30"
        },
        {
          "rel": "self",
          "href": "/mobile/platform/location/assets/30"
        }
      ]
    },
    {
      "id": 31,
      "createdOn": "2017-09-19T21:48:21.168Z",
      "createdBy": "administrator",
      "modifiedOn": "2017-09-19T21:48:21.168Z",
      "modifiedBy": "administrator",
      "name": "gen233",
      "label": "Generator #233",
      "description": "Portable inverter generator",
      "lastKnownLocation": null,
      "attributes": {
        "serial number": "6754843090",
        "watts": "1600"
      },
      "links": [
        {
          "rel": "canonical",
          "href": "/mobile/platform/location/assets/31"
        },
        {
          "rel": "self",
          "href": "/mobile/platform/location/assets/31"
        }
      ]
    },
    {
      "id": 32,
      "createdOn": "2017-09-19T21:48:21.173Z",
      "createdBy": "administrator",
      "modifiedOn": "2017-09-19T21:48:21.173Z",
      "modifiedBy": "administrator",
      "name": "exc15",
      "label": "Excavator #15",
      "description": "Hydraulic excavator",
      "lastKnownLocation": null,
      "attributes": {
        "cylinders": "4",
        "serial number": "13A3168G"
      },
      "links": [
        {
          "rel": "canonical",
          "href": "/mobile/platform/location/assets/32"
        },
        {
          "rel": "self",
          "href": "/mobile/platform/location/assets/32"
        }
      ]
    },
    {
      "id": 33,
      "createdOn": "2017-09-19T21:48:21.177Z",
      "createdBy": "administrator",
      "modifiedOn": "2017-09-19T21:48:21.177Z",
      "modifiedBy": "administrator",
      "name": "wd23",
      "label": "Waste dumpster #23",
      "description": "DR 40 yd dumpster",
      "lastKnownLocation": null,
      "attributes": {
        "capacity": "40 yd",
        "height": "3.5 ft",
        "serial number": "mx58sk"
      },
      "links": [
        {
          "rel": "canonical",
          "href": "/mobile/platform/location/assets/33"
        },
        {
          "rel": "self",
          "href": "/mobile/platform/location/assets/33"
        }
      ]
    }
  ]
}