Create or update a shift

put

/rest/ofscMetadata/v1/shifts/{label}

This operation creates a new shift or updates an existing shift.

  • If shift with 'label' already exists, the function replaces it with the new values.
  • Response code 200 is returned when an shift object is updated.
  • Response code 201 is returned when an shift object is created.

Request

Path Parameters
  • Minimum Length: 1
    Maximum Length: 32
    The label of the shift that is used in the request URL to create a new shift or update an existing shift.
Body ()
The shift object created or updated in Oracle Field Service.
Root Schema : shift
Type: object
Title: shift
The shift object.
Show Source
  • Title: Active
    Contains one of the following values: true or false.

    If true, then the shift is listed as a possible value in the 'shift' drop-down list in Manage or Mobility apps while creating an activity. If false, then the shift is not listed as a value in the drop-down list. The default value is true.

  • Title: Type
    The decoration of the shift. Mandatory for "on-call" type of shift. Possible values are ["yellow","orange","red","blue","green","purple"].
  • Title: Name
    The label of the shift.
  • Title: Points
    Points
  • Title: Type
    The type of the shift. Possible values are ["regular", "on-call"]. Cannot be changed for an existing shift.
  • Title: WorkTimeStart
    The workTimeEnd of the shift. Possible values are 00:00 - 23:59
  • Title: WorkTimeStart
    The workTimeStart of the shift. Possible values are 00:00 - 23:59
Back to Top

Response

Supported Media Types

200 Response

This section describes the 200 status response for this operation. The 200 status code is returned when an shift object is updated.
Body ()
Root Schema : Shift
Type: object
Title: Shift
The shift object.
Show Source
  • Title: Active
    Contains one of the following values: true or false.

    If true, then the shift is listed as a possible value in the 'shift' drop-down list in Manage or Mobility apps while creating an activity. If false, then the shift is not listed as a value in the drop-down list. The default value is true.

  • Title: Type
    The decoration of the shift. Mandatory for "on-call" type of shift. Possible values are ["yellow","orange","red","blue","green","purple"].
  • Title: Name
    The label of the shift.
  • Title: Points
    Points
  • Title: Type
    The type of the shift. Possible values are ["regular", "on-call"]. Cannot be changed for an existing shift.
  • Title: WorkTimeStart
    The workTimeEnd of the shift. Possible values are 00:00 - 23:59
  • Title: WorkTimeStart
    The workTimeStart of the shift. Possible values are 00:00 - 23:59

201 Response

This section describes the 201 status response for this operation. This response code indicates that the shift object is created. The shift object is returned in the response.
Body ()
Root Schema : Shift
Type: object
Title: Shift
The shift object.
Show Source
  • Title: Active
    Contains one of the following values: true or false.

    If true, then the shift is listed as a possible value in the 'shift' drop-down list in Manage or Mobility apps while creating an activity. If false, then the shift is not listed as a value in the drop-down list. The default value is true.

  • Title: Type
    The decoration of the shift. Mandatory for "on-call" type of shift. Possible values are ["yellow","orange","red","blue","green","purple"].
  • Title: Name
    The label of the shift.
  • Title: Points
    Points
  • Title: Type
    The type of the shift. Possible values are ["regular", "on-call"]. Cannot be changed for an existing shift.
  • Title: WorkTimeStart
    The workTimeEnd of the shift. Possible values are 00:00 - 23:59
  • Title: WorkTimeStart
    The workTimeStart of the shift. Possible values are 00:00 - 23:59

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 or update a shift by by submitting a PUT request on the REST resource using cURL.

curl -u '<CLIENT-ID>@<INSTANCE-NAME>:<CLIENT-SECRET>' -X PUT --data @request.json 'https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/shifts/{label}

Example of Request Body

The following shows an example of the request body in json format.

{
        "name": "Regular Shift",
        "active": true,
        "type":"regular"
        "points": 13,
        "workTimeStart": "00:00",
        "workTimeEnd": "18:00"
}

Example of Response Body

The following shows an example of the response body in json format.

{
        "name": "Regular Shift",
        "active": true,
        "type":"regular",
        "points": 13,
        "workTimeStart": "00:00",
        "workTimeEnd": "18:00"
        "label": "type_on_regular_shift"
}
Back to Top