Create a work zone

post

/rest/ofscMetadata/v1/workZones

This operation creates a new work zone.

The following criteria applies while creating a work zone:

  • Fields must not have any blank spaces at the end, for example 'a '. All white spaces are ignored.
  • Values in the keys arrays must be unique.
  • Same key may be present only once across all the active work zones (inactive work zones are ignored).
  • Values in the shapes arrays must be unique.
  • Same shape may be present only once across the all active work zones (inactive work zones are ignored).
  • Validation is not case sensitive, that is 'a' is the same as 'A'.

Request

Query Parameters
  • This parameter automatically resolves conflicts in work zone keys. If the value of this parameter is specified, then Oracle Field Service automatically removes the specified work zone keys from other active work zones. This parameter applies only if the work zone being created or updated is active.
Body ()
The work zone object that needs to be created.
Root Schema : Work Zone
Type: object
Title: Work Zone
Show Source
Nested Schema : Keys
Type: array
Title: Keys
Show Source
Nested Schema : Shapes
Type: array
Title: Shapes
Show Source
Back to Top

Response

Supported Media Types

201 Response

This section describes the 201 status response for this operation. This code indicates that the work zone object is created.
Body ()
Root Schema : Work Zone
Type: object
Title: Work Zone
Show Source
Nested Schema : Keys
Type: array
Title: Keys
Show Source
Nested Schema : Shapes
Type: array
Title: Shapes
Show Source

Default Response

This section describes the default error response for this operation.
Body ()
Root Schema : Error
Type: object
Show Source
Back to Top

Examples

The following example shows how to create work zone by submitting a POST request on the REST resource using cURL.

curl -X 
POST -H "Authorization: Basic c29hcEBtYXAtd3o6MQ==" 
     -H "Cache-Control: no-cache" 
     -H "Postman-Token: fcde2e14-b148-1920-876a-c00fef9b0355" 
     -d '
{
    "workZoneLabel": "RESTZONE",
    "status":        "active",
    "travelArea":    "New",
    "keys":          ["KYiV","KHrK"],
    "shapes":        ["SHAPE1A", "SHAPE2b"]
}
' "https://ofsc1.vm/master/wwwroot/rest/ofscMetadata/v1/workZones?request_auth_basic&pretty"

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 200 Ok
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.

{
  "workZoneLabel": "RESTZONE",
  "status": "active",
  "travelArea": "New",
  "keys": 
  [
    "KYiV",
    "KHrK"
  ],

  "shapes": 
  [
    "SHAPE1A",
    "SHAPE2b"
  ],
  
 "links": 
  [
    {
      "rel": "canonical",
      "href": "https://ofsc1.vm/master/wwwroot/rest/ofscMetadata/v1/workZones/RESTZONE"
    },
    {
      "rel": "describedby",
      "href": "https://ofsc1.vm/master/wwwroot/rest/ofscMetadata/v1/metadata-catalog/workZones"
    }
  ]
}
Back to Top