Get time slots
/rest/ofscMetadata/v1/timeSlots
This operation retrieves a collection of time slots.
Configuration: You must grant permissions to the Core API and must at least set Read-Only access to the timeslots entity in the Configuration, Applications (API permissions) screen.
Request
-
limit: integer
The number of time slot records to be returned in the response. The minimum value that can be specified is 1 and the maximum value that can be specified is 100. If the specified value is greater than 100, zero, or if no value is specified, then it defaults to 100.
-
offset: integer
The record number from which the retrieval starts. The default value is zero. If no value is specified, then it defaults to zero. The value zero indicates that the retrieval will start from the beginning of the collection.
Response
- application/json
- application/schema+json
200 Response
object
-
hasMore:
boolean
Contains one of the following values: true or false.
If true, then there are more results that can be retrieved with successive paging requests.
If false or if the value is not present, then there are no more results or this is the final page. The default value is true.
-
items:
array items
-
limit:
integer
The limit value specified in the request. If the value is not specified in the request or if the specified value is not accepted, then it defaults to 100.
-
offset:
integer
The offset value specified in the request.
-
totalResults:
integer
The total number of the time slots records in the collection.
object
Time Slot
-
active(required):
boolean
Title:
Active
Contains one of the following values: true or false.
If true, then the time slot is listed as an option in the Time slot drop-down list in the Oracle Field Service application. If false, then the time slot is not listed as an option in the drop-down list. The default value is true. -
isAllDay(required):
boolean
Title:
Is All Day
Contains one of the following values: true or false. If true, then the activities with the 'allDay' time slot can be performed at any time during the day. If false, then the activities cannot be performed at any time during the day. The default value is false. -
label(required):
string
Title:
Label
Minimum Length:1
Maximum Length:40
The unique label assigned to the time slot. -
name(required):
string
Title:
Name
Minimum Length:1
Maximum Length:40
The name of the time slot. For example, 8-10. -
timeEnd:
string
Title:
Time End
The time when the time slot ends. For example, 16:00 hours. -
timeStart:
string
Title:
Time Start
The time when the time slot starts. For example, 14:00 hours.
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 obtain a collection of resource types by using the language parameter with the GET request on the REST resource.
Use the cURL command with the following syntax:
curl -u '<CLIENT-ID>@<INSTANCE-NAME>:<CLIENT-SECRET>' \ -H 'Accept: application/json' \ 'https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/timeSlots/?limit=2&offset=2'
Response Header Example
The following shows an example of the response header.
HTTP/1.1 200 OK Server: nginx Date: Wed, 24 Jan 2018 12:28:18 GMT Content-Type: application/json; charset=utf-8 Connection: close
Response Body Example
The following shows an example of the response body in JSON format:
{ "hasMore": true, "totalResults": 10, "limit": 2, "offset": 2, "items": [ { "label": "08-10", "name": "08-10", "active": true, "isAllDay": false, "timeStart": "08:00", "timeEnd": "10:00", "links": [ { "rel": "describedby", "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/metadata-catalog/timeSlots" } ] }, { "label": "all-day", "name": "All-Day", "active": true, "isAllDay": true, "links": [ { "rel": "describedby", "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/metadata-catalog/timeSlots" } ] } ], "links": [ { "rel": "canonical", "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/timeSlots/?limit=2&offset=2" }, { "rel": "prev", "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/timeSlots/?limit=2&offset=0" }, { "rel": "next", "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/timeSlots/?limit=2&offset=4" }, { "rel": "describedby", "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/metadata-catalog/timeSlots" } ] }