Add Places from File
/mobile/system/locationManagement/places/upload
Adds the places that are defined in a file in CSV format.
The CSV format is: name,label,description,gpsPointLat:gpsPointLong,gpsCircleLat:gpsCircleLong:gpsCircleRadius,gpsPolygonLat:gpsPolygonLong,attributeKey1=attributeValue1,attributeKey2=attributeValue2
You can have multiple gpsPolygonLat:gpsPolygonLong
values separated by ;
(semicolon).
The attributeKey=attributeValue
value is optional, and you can have multiple attributeKey=attributeValue
values separated by a ,
(comma).
For example:
#version=1.0
FixItFast Redwood City Warehouse #1,FixItFast Warehouse,FixItFast Warehouse in Redwood City,37.5548:-121.1566,,,hours=9am-6pm
FixItFast Redwood City Warehouse #2,FixItFast Warehouse,FixItFast Warehouse in Redwood City,,37.9856:-120.8745:30000,,hours=8am-5pm
FixItFast Redwood City Warehouse #3,FixItFast Warehouse,FixItFast Warehouse in Redwood City,,,37.8453:-121.7845;37.1248:-120.9853;37.6983:-121.7758,hours=6am-3pm
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
object
Place Items Array
-
items(optional):
array items
Minimum Number of Items:
1
Array of the created places.
array
1
-
Array of:
object Place
Title:
Place
The created or updated place.
object
Place
-
address(optional):
object Place's Address
Title:
Place's Address
GPS address of the place. -
attributes(optional):
object Attributes
Title:
Attributes
Additional Properties Allowed: additionalPropertiesThe attributes entered in the UI, as key/value pairs. -
children(optional):
array children
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. -
createdBy:
string
User who added the place.
-
createdOn:
string
When the place was added.
-
description:
string
Place's description.
-
devices(optional):
array devices
Minimum Number of Items:
0
Devices associated with this place. Typically one device, but there can be multiple devices. -
hasChildren(optional):
boolean
Set to `true` if this place is a parent of other places.
-
id:
number
Place's ID.
-
label(optional):
string
Place's label.
-
links:
array Relationship links
Title:
Relationship links
Minimum Number of Items:1
Unique Items Required:true
-
modifiedBy(optional):
string
User who last modified the place.
-
modifiedOn(optional):
string
When the place was last modified.
-
name:
string
User-defined name for the place.
-
parentPlace(optional):
number
Place ID of the place's parent.
object
Place's Address
object
Attributes
array
0
-
Array of:
object Place
Title:
Place
The created or updated place.
array
0
-
Array of:
object 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.
array
Relationship links
1
true
-
Array of:
object Link
Title:
Link
object
-
latitude(optional):
number
GPS point's latitude
-
longitude(optional):
number
GPS point's longitude.
object
-
latitude(optional):
number
Latitude of the center of the GPS circle.
-
longitude(optional):
number
Longitude of the center of the GPS circle.
-
radius(optional):
number
GPS circle's radius in meters.
object
-
vertices(optional):
array vertices
Minimum Number of Items:
1
GPS polygon's vertices.
array
1
-
Array of:
object latitudeLongitudePair
Pair of latitude and longitude values for a place.
object
-
latitude(optional):
number
Place's latitude.
-
longitude(optional):
number
Place's longitude.
object
Associated Location Device
-
attributes(optional):
object Attributes
Title:
Attributes
Additional Properties Allowed: additionalPropertiesThe attributes entered in the UI, as key/value pairs. -
beacon(optional):
object Beacon
Title:
Beacon
Device'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 links
Minimum Number of Items:1
Unique Items Required:true
-
modifiedBy(optional):
string
User who last modified the device.
-
modifiedOn(optional):
string
When the device was last modified.
-
name:
string
User-defined name for the device.
object
Beacon
object
-
major(optional):
string
Device's major version number.
-
minor(optional):
string
Device's minor version number.
-
uuid(optional):
string
Device's UUID.
object
-
id1(optional):
string
Device's first ID.
-
id2(optional):
string
Device's second ID.
-
id3(optional):
string
Device's third ID.
object
-
eddystoneUid(optional):
object eddystoneUid
Device's UID.
-
eddystoneUrl(optional):
object eddystoneUrl
Device's URL.
object
-
instance(optional):
string
Individual device's ID.
-
namespace(optional):
string
Namespace that the device is a member of.
object
Link
-
href:
string
A relative URL.
-
rel:
Allowed Values:
[ "self", "canonical", "prev", "next" ]
The type of link.
{
"items":[
{
"modifiedOn":"2015-08-06T18:37:41.995Z",
"address":{
"gpsPoint":{
"latitude":37.5548,
"longitude":-121.1566
}
},
"createdBy":"jdoe",
"hasChildren":false,
"name":"FixItFast Redwood City Warehouse #1",
"description":"FixItFast Warehouse in Redwood City",
"modifiedBy":"jdoe",
"links":[
{
"rel":"canonical",
"href":"/mobile/platform/location/places/113"
},
{
"rel":"self",
"href":"/mobile/platform/location/places/113"
}
],
"attributes":{
"hours":"9am-6pm"
},
"label":"FixItFast Warehouse",
"id":113,
"createdOn":"2015-08-06T18:37:41.995Z"
},
{
"modifiedOn":"2015-08-06T18:37:42.093Z",
"address":{
"gpsCircle":{
"latitude":37.9856,
"radius":30000,
"longitude":-120.8745
}
},
"createdBy":"jdoe",
"hasChildren":false,
"name":"FixItFast Redwood City Warehouse #2",
"description":"FixItFast Warehouse in Redwood City",
"modifiedBy":"jdoe",
"links":[
{
"rel":"canonical",
"href":"/mobile/platform/location/places/114"
},
{
"rel":"self",
"href":"/mobile/platform/location/places/114"
}
],
"attributes":{
"hours":"8am-5pm"
},
"label":"FixItFast Warehouse",
"id":114,
"createdOn":"2015-08-06T18:37:42.093Z"
},
{
"modifiedOn":"2015-08-06T18:37:42.174Z",
"address":{
"gpsPolygon":{
"vertices":[
{
"latitude":37.8453,
"longitude":-121.7845
},
{
"latitude":37.1248,
"longitude":-120.9853
},
{
"latitude":37.6983,
"longitude":-121.7758
}
]
}
},
"createdBy":"jdoe",
"hasChildren":false,
"name":"FixItFast Redwood City Warehouse #3",
"description":"FixItFast Warehouse in Redwood City",
"modifiedBy":"jdoe",
"links":[
{
"rel":"canonical",
"href":"/mobile/platform/location/places/115"
},
{
"rel":"self",
"href":"/mobile/platform/location/places/115"
}
],
"attributes":{
"hours":"6am-3pm"
},
"label":"FixItFast Warehouse",
"id":115,
"createdOn":"2015-08-06T18:37:42.174Z"
}
]
}
400 Response
Bad request.
object
Error
-
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(optional):
array o:errorDetails
Minimum Number of Items:
0
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.
array
0
-
Array of:
object Error Detail
Title:
Error Detail
object
Error Detail
-
instance:
string
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 places 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 @places.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/places/upload
Examples of Request Body
The following shows an example of the upload file.
#version=1.0
entranceSouth,public access,South Entrance New City,37.845:-121.7845,,,guardStation=true
Example of Response Header
The following shows an example of the response header:
200 OK Content-Length: 497 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":50,
"createdOn":"2017-09-21T21:56:27.296Z",
"createdBy":"administrator",
"modifiedOn":"2017-09-21T21:56:27.296Z",
"modifiedBy":"administrator",
"name":"entranceSouth",
"label":"public access",
"description":"South Entrance New City",
"hasChildren":false,
"address":{
"gpsPoint":{
"longitude":-121.7845,
"latitude":37.845
}
},
"attributes":{
"guardStation":"true"
},
"links":[
{
"rel":"canonical",
"href":"/mobile/platform/location/places/50"
},
{
"rel":"self",
"href":"/mobile/platform/location/places/50"
}
]
}
]
}