Add Places

post

/mobile/system/locationManagement/places

Creates one or more location places.

Permissions

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

Request

Supported Media Types
Body ()
Root Schema : Place Items Array
Type: object
Title: Place Items Array
Show Source
Nested Schema : items
Type: array
Minimum Number of Items: 1
Array of the places to be created.
Show Source
Nested Schema : Create Place
Type: object
Title: Create Place
The place to be created.
Show Source
Nested Schema : Place's Address
Type: object
Title: Place's Address
GPS address of the place.
Match One
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 : devices
Type: array
Minimum Number of Items: 0
IDs of devices that are associated with this place. Typically one device, but there can be multiple devices.
Show Source
Nested Schema : gpsPoint
Type: object
GPS point.
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 Request (application/json)
{
    "items":[
        {
            "address":{
                "gpsPoint":{
                    "longitude":122,
                    "latitude":37
                }
            },
            "description":"FixItFast Warehouse in Redwood City",
            "name":"FixItFast Redwood City Warehouse",
            "label":"FixItFast Warehouse",
            "attributes":{
                "hours":"9am-6pm"
            },
            "devices":[
                12345
            ],
            "parentPlace":42
        }
    ]
}
Back to Top

Response

Supported Media Types

200 Response

The location places were created successfully.
Body ()
Root Schema : Place Items Array
Type: object
Title: Place Items Array
Show Source
Nested Schema : items
Type: array
Minimum Number of Items: 1
Array of the created places.
Show Source
Nested Schema : Place
Type: object
Title: Place
The created or updated place.
Show Source
Nested Schema : Place's Address
Type: object
Title: Place's Address
GPS address of the place.
Match One
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 : children
Type: array
Minimum Number of Items: 0
Places that are the child places of this place. This includes the full hierarchy of places that descend from this place.
Show Source
Nested Schema : devices
Type: array
Minimum Number of Items: 0
Devices associated with this place. Typically one device, but there can be multiple devices.
Show Source
Nested Schema : gpsPoint
Type: object
GPS point.
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
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
Example Response (application/json)
{
    "items":[
        {
            "createdOn":"2015-08-06T18:37:59.424Z",
            "id":112,
            "modifiedOn":"2015-08-06T18:37:59.424Z",
            "hasChildren":false,
            "createdBy":"jdoe",
            "address":{
                "gpsPoint":{
                    "longitude":122,
                    "latitude":37
                }
            },
            "description":"FixItFast Warehouse in Redwood City",
            "modifiedBy":"jdoe",
            "name":"FixItFast Redwood City Warehouse",
            "links":[
                {
                    "rel":"canonical",
                    "href":"/mobile/platform/location/places/112"
                },
                {
                    "rel":"self",
                    "href":"/mobile/platform/location/places/112"
                }
            ],
            "label":"FixItFast Warehouse",
            "attributes":{
                "hours":"9am-6pm"
            },
            "devices":[
                {
                    "id":12345,
                    "createdOn":"2015-08-06T18:37:59.424Z",
                    "modifiedOn":"2015-08-08T07:22:44.654Z",
                    "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"
                    }
                }
            ],
            "parentPlace":42
        }
    ]
}

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

This example shows how to use cURL to create places by submitting a POST request on the REST resource.

curl -i \
-X POST \ 
-u administrator@example.com:mypassword \
-d @places.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/places

Examples of Request Body

Here's an example of the request body.

{
  "items": [
        {
            "name": "l1b1",
            "label": "lot 1 block 1",
            "description": "Lot 1 block 1 New City",
            "address" : {
                "gpsCircle" : {
                    "latitude": 37.9856,
                    "longitude": -120.8745,
                    "radius": 30000
                }
            },
            "properties" : {
                "acres": ".25"
            }
            
        },
        {
            "name": "l2b1",
            "label": "lot2 block 1",
            "description": "Lot 2 block 1 New City",
            "address" : {
                "gpsPolygon" : {
                    "vertices": [
                        {
                            "latitude": 37.8453,
                            "longitude": -121.7845
                        },
                        {
                            "latitude": 37.1248,
                            "longitude": -120.9853
                        },
                        {
                            "latitude": 37.6983,
                            "longitude": -121.7758
                        }
                     ]
                }
            },
            "properties" : {
                "acres": ".25"
            }
            
        }
    ]
}

Example of Response Header

Here's an example of the response header:

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

Example of Response Body

Here's an example of the response body:

{
    "items": [
        {
            "id": 30,
            "createdOn": "2017-09-19T23:14:50.300Z",
            "createdBy": "administrator",
            "modifiedOn": "2017-09-19T23:14:50.300Z",
            "modifiedBy": "administrator",
            "name": "l1b1",
            "label": "lot 1 block 1",
            "description": "Lot 1 block 1 New City",
            "hasChildren": false,
            "address": {
                "gpsCircle": {
                    "longitude": -120.8745,
                    "latitude": 37.9856,
                    "radius": 30000
                }
            },
            "attributes": {
                "acres": ".25"
            },
            "links": [
                {
                    "rel": "canonical",
                    "href": "/mobile/platform/location/places/30"
                },
                {
                    "rel": "self",
                    "href": "/mobile/platform/location/places/30"
                }
            ]
        },
        {
            "id": 31,
            "createdOn": "2017-09-19T23:14:50.316Z",
            "createdBy": "uimcs",
            "modifiedOn": "2017-09-19T23:14:50.316Z",
            "modifiedBy": "uimcs",
            "name": "l2b1",
            "label": "lot2 block 1",
            "description": "Lot 2 block 1 New City",
            "hasChildren": false,
            "address": {
                "gpsPolygon": {
                    "vertices": [
                        {
                            "longitude": -121.7845,
                            "latitude": 37.8453
                        },
                        {
                            "longitude": -120.9853,
                            "latitude": 37.1248
                        },
                        {
                            "longitude": -121.7758,
                            "latitude": 37.6983
                        }
                    ]
                }
            },
            "attributes": {
                "acres": ".25"
            },
            "links": [
                {
                    "rel": "canonical",
                    "href": "/mobile/platform/location/places/31"
                },
                {
                    "rel": "self",
                    "href": "/mobile/platform/location/places/31"
                }
            ]
        }
    ]
}
Back to Top