Create a resource location
/rest/ofscCore/v1/resources/{resourceId}/locations
This operation creates a location for the specified resource.
After the location is created, use the 'Set assignedlocation' operation to assign the 'start', 'end', or 'home zone center' locations to the resource.
The operation supports custom properties of data type string, enumeration, and integer. You can only specify the properties that are present in the activity travel key configuration. The properties that are not present in the activity travel key configuration are ignored.
Request
-
resourceId(required): string
The unique identifier of the resource.
object
Resource Location
-
address:
string
Title:
Address
The address of the resource. -
city:
string
Title:
City
The city in which the address is located. -
country:
string
Title:
Country
The country in which the address is located. Note that modification of this filed only without changes in other address fields will not trigger coordinates resolution -
label:
string
Title:
Label
The unique label of the resource location. -
latitude:
number
Title:
Latitude
Minimum Value:-90
Maximum Value:90
The geographic coordinates of the resource location. -
longitude:
number
Title:
Longitude
Minimum Value:-180
Maximum Value:180
The geographic coordinates of the resource location. -
postalCode:
string
Title:
Postal Code
The postal code of the resource location. -
privateLocationFlag:
boolean
Title:
Location is private
Default Value:false
Indicates whether the location is a resource private location. -
state:
string
Title:
State
The state in which the address is located. -
status:
string
Title:
Status
The status of the resource location. If request doesn't contain "status", but coordinates are present, "status" will be sent as "manual"
Response
- application/json
201 Response
object
Resource Location
-
address:
string
Title:
Address
The address of the resource. -
city:
string
Title:
City
The city in which the address is located. -
country:
string
Title:
Country
The country in which the address is located. -
label:
string
Title:
Label
The unique label of the resource location. -
latitude:
number
Title:
Latitude
Minimum Value:-90
Maximum Value:90
The geographic coordinates of the resource location. -
locationId:
integer
Title:
Location ID
The unique identifier of the resource location. -
longitude:
number
Title:
Longitude
Minimum Value:-180
Maximum Value:180
The geographic coordinates of the resource location. -
postalCode:
string
Title:
Postal Code
The postal code of the resource location. -
privateLocationFlag:
boolean
Title:
Location is private
Default Value:false
Indicates whether the location is a resource private location. -
state:
string
Title:
State
The state in which the address is located. -
status:
string
Title:
Status
The status of the resource location.
Default Response
object
-
detail:
string
The detailed description of this error.
-
status:
string
The HTTP status code of this error.
-
title(required):
string
The brief description of this error.
-
type(required):
string
The URL of the web page containing more details about this error.
Examples
The following example shows how to create resource location by submitting a POST request on the REST resource.
Example of Request Header
The following shows an example of the request header.
POST /rest/ofscCore/v1/resources/44035/locations HTTP/1.0 Authorization: Basic c29hcEB5YW1hdG86MQ== Host: <instance_name>.fs.ocs.oraclecloud.com Accept: */*
Example of Request Body
The following shows an example of the request body in JSON format.
{ "label": "Warehouse EU1", "postalCode": "32817", "city": "Orlando", "state": "FL", "address": "11350-11398 University Blvd, Orlando", "longitude": -81.22226, "latitude": 28.59752, "status": "manual" }
Example of Response Header
The following shows an example of the response header.
HTTP/1.1 201 Created Server: nginx/1.6.2 Date: Fri, 24 Jul 2015 08:35:48 GMT Content-Type: application/json; charset=utf-8 Connection: close
Example of Response Body
The following example shows the contents of the response body in JSON format.
{ "label": "Warehouse EU1", "postalCode": "32817", "city": "Orlando", "state": "FL", "address": "11350-11398 University Blvd, Orlando", "longitude": -81.22226, "latitude": 28.59752, "status": "manual", "locationId": 3, "links": [ { "rel": "canonical", "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/44008/locations/3" }, { "rel": "describedby", "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/metadata-catalog/resources" } ] }