Zoho: Get a shift hour
Zoho shiftHours.getSingleShiftHour: arguments, response, policy and SDK examples.
← Shift hours operations · Get started
Operation zoho.getsingleshifthour
Provider route: GET /crm/v8/settings/business_hours/shift_hours/{shift}. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/zoho with npm, or alter-sdk-zoho with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { ZohoIntegration } from "@alter-ai/zoho";
async function execute(input: Parameters<ZohoIntegration["shiftHours"]["getSingleShiftHour"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new ZohoIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.shiftHours.getSingleShiftHour(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_zoho import ZohoIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = ZohoIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.shift_hours.get_single_shift_hour(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.shift | string | Required within parent | Maximum length: 50 |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | object | Alternative | Represents the error response body for the operation. Additional keys: not allowed |
$ (anyOf 1).shift_count | object | Required within parent | Represents aggregate counts that summarize the shift hour configurations returned in the response. Additional keys: not allowed |
$ (anyOf 1).shift_count.total_shift_with_user | JSON | Required within parent | |
$ (anyOf 1).shift_count.total_shift_with_user (anyOf 1) | integer | Alternative | Represents the total number of shift hours that have at least one user assigned. Format: int32 |
$ (anyOf 1).shift_count.total_shift_with_user (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
$ (anyOf 1).shift_hours | array | Required within parent | Lists the shift hour configurations returned in the response. Maximum items: 50 |
$ (anyOf 1).shift_hours[] | object | Each item | Each object represents one shift hour with its timing, break hours, holidays, and assigned users. Additional keys: not allowed |
$ (anyOf 1).shift_hours[].break_hours | JSON | Required within parent | |
$ (anyOf 1).shift_hours[].break_hours (anyOf 1) | array | Alternative | Lists the break windows scheduled within the shift hour. A shift can have at most two break windows. Maximum items: 50 |
$ (anyOf 1).shift_hours[].break_hours (anyOf 1)[] | Model | Each item | Expand Get a shift hour — response body — shift count, shift hours shift hours item break hours null item |
$ (anyOf 1).shift_hours[].break_hours (anyOf 2) | null | Alternative | Lists the break windows scheduled within the shift hour. A shift can have at most two break windows. Maximum items: 50 |
$ (anyOf 1).shift_hours[].break_hours (anyOf 2)[] | Model | Each item | Expand Get a shift hour — response body — shift count, shift hours shift hours item break hours null item |
$ (anyOf 1).shift_hours[].custom_timing | JSON | Required within parent | |
$ (anyOf 1).shift_hours[].custom_timing (anyOf 1) | array | Alternative | Lists per-day shift timing overrides. This field is mandatory when same_as_everyday is false. Maximum items: 50 |
$ (anyOf 1).shift_hours[].custom_timing (anyOf 1)[] | Model | Each item | Expand Get a shift hour — response body — shift count, shift hours shift hours item custom timing null item |
$ (anyOf 1).shift_hours[].custom_timing (anyOf 2) | null | Alternative | Lists per-day shift timing overrides. This field is mandatory when same_as_everyday is false. Maximum items: 50 |
$ (anyOf 1).shift_hours[].custom_timing (anyOf 2)[] | Model | Each item | Expand Get a shift hour — response body — shift count, shift hours shift hours item custom timing null item |
$ (anyOf 1).shift_hours[].daily_timing | JSON | Required within parent | |
$ (anyOf 1).shift_hours[].daily_timing (anyOf 1) | array | Alternative | Represents the start and end time of the shift in `HH:MM` 24-hour format, applied uniformly to every active day. This field is mandatory when same_as_everyday is true. Maximum items: 50 |
$ (anyOf 1).shift_hours[].daily_timing (anyOf 1)[] | string | Each item | Each object represents the start time or end time of the window in `HH:MM` 24-hour format. Maximum length: 5 Pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$ |
$ (anyOf 1).shift_hours[].daily_timing (anyOf 2) | null | Alternative | Represents the start and end time of the shift in `HH:MM` 24-hour format, applied uniformly to every active day. This field is mandatory when same_as_everyday is true. Maximum items: 50 |
$ (anyOf 1).shift_hours[].daily_timing (anyOf 2)[] | string | Each item | Each object represents the start time or end time of the window in `HH:MM` 24-hour format. Maximum length: 5 Pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$ |
$ (anyOf 1).shift_hours[].holidays | JSON | Required within parent | |
$ (anyOf 1).shift_hours[].holidays (anyOf 1) | array | Alternative | Lists the holidays observed during the shift hour. The holiday date must fall between the current and the next financial year. Maximum items: 50 |
$ (anyOf 1).shift_hours[].holidays (anyOf 1)[] | Model | Each item | Expand Get a shift hour — response body — shift count, shift hours shift hours item holidays null item |
$ (anyOf 1).shift_hours[].holidays (anyOf 2) | null | Alternative | Lists the holidays observed during the shift hour. The holiday date must fall between the current and the next financial year. Maximum items: 50 |
$ (anyOf 1).shift_hours[].holidays (anyOf 2)[] | Model | Each item | Expand Get a shift hour — response body — shift count, shift hours shift hours item holidays null item |
$ (anyOf 1).shift_hours[].id | string | Required within parent | Represents the unique identifier of the shift hour. Maximum length: 100 |
$ (anyOf 1).shift_hours[].name | string | Required within parent | Represents the name of the shift hour. The name must be unique within the organization and must not contain the special characters. Maximum length: 80 |
$ (anyOf 1).shift_hours[].same_as_everyday | boolean | Required within parent | Indicates whether the shift hour follows the same timing on every active day. Possible values: - true - the shift hour uses the same timing every day, and daily_timing becomes mandatory. - false - the shift hour uses different timing for different days, and custom_timing becomes mandatory. |
$ (anyOf 1).shift_hours[].shift_days | array | Required within parent | Lists the days of the week on which the shift hour is active. You can set shift timing only on the days your organization operates. Maximum items: 7 |
$ (anyOf 1).shift_hours[].shift_days[] | string | Each item | Represents the day of the week on which the shift hour is active. Possible values: - Monday - Tuesday - Wednesday - Thursday - Friday - Saturday - Sunday Known values: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday |
$ (anyOf 1).shift_hours[].timezone | string | Required within parent | Represents the time zone in which the shift hours are scheduled. Maximum length: 100 |
$ (anyOf 1).shift_hours[].users | JSON | Required within parent | |
$ (anyOf 1).shift_hours[].users (anyOf 1) | array | Alternative | Lists the users assigned to the shift hour. Each entry specifies the user and the date from which the assignment becomes effective. Maximum items: 200 |
$ (anyOf 1).shift_hours[].users (anyOf 1)[] | Model | Each item | Expand Get a shift hour — response body — shift count, shift hours shift hours item users null item |
$ (anyOf 1).shift_hours[].users (anyOf 2) | null | Alternative | Lists the users assigned to the shift hour. Each entry specifies the user and the date from which the assignment becomes effective. Maximum items: 200 |
$ (anyOf 1).shift_hours[].users (anyOf 2)[] | Model | Each item | Expand Get a shift hour — response body — shift count, shift hours shift hours item users null item |
$ (anyOf 1).shift_hours[].users_count | JSON | Required within parent | |
$ (anyOf 1).shift_hours[].users_count (anyOf 1) | integer | Alternative | Represents the number of users currently assigned to the shift hour. Format: int32 |
$ (anyOf 1).shift_hours[].users_count (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
$ (anyOf 2) | null | Alternative |
Referenced models: Get a shift hour — response body — shift count, shift hours shift hours item break hours null item, Get a shift hour — response body — shift count, shift hours shift hours item custom timing null item, Get a shift hour — response body — shift count, shift hours shift hours item holidays null item, Get a shift hour — response body — shift count, shift hours shift hours item users null item
Schemas
Section titled “Schemas”Get a shift hour — response body — shift count, shift hours shift hours item break hours null item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Each object specifies the days the break applies to and the break timing for those days. Additional keys: not allowed |
break_days | array | Required within parent | Lists the days of the week on which the break hour applies. Maximum items: 7 |
break_days[] | string | Each item | Each string represents a day of the week on which the break hour applies. Maximum length: 100 |
custom_timing | JSON | Required within parent | |
custom_timing (anyOf 1) | array | Alternative | Lists per-day break timing overrides. This field is **mandatory** when the parent **same_as_everyday** is **false**. A day can have at most two breaks and the total break time on a day cannot exceed two hours. Maximum items: 50 |
custom_timing (anyOf 1)[] | Model | Each item | Expand Get a shift hour — response body — shift count, shift hours shift hours item break hours null item custom timing Lists per-day break timing overrides item |
custom_timing (anyOf 2) | null | Alternative | Lists per-day break timing overrides. This field is **mandatory** when the parent **same_as_everyday** is **false**. A day can have at most two breaks and the total break time on a day cannot exceed two hours. Maximum items: 50 |
custom_timing (anyOf 2)[] | Model | Each item | Expand Get a shift hour — response body — shift count, shift hours shift hours item break hours null item custom timing Lists per-day break timing overrides item |
daily_timing | array | Required within parent | Represents the start and end time of the break in `HH:MM` 24-hour format, applied uniformly to every day the break is scheduled. This field is **mandatory** when the parent **same_as_everyday** is **true**. A day can have at most two breaks and the total break time on a day cannot exceed two hours. Maximum items: 50 |
daily_timing[] | string | Each item | Each string represents the start time or end time of the window in `HH:MM` 24-hour format. Maximum length: 5 Pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$ |
id | string | Required within parent | Represents the unique identifier of the break hour within the shift hour. Maximum length: 100 |
same_as_everyday | boolean | Required within parent | Indicates whether the break hour follows the same timing on every day the break is scheduled. **Possible values**: - **true** - the break hour uses the same timing every day, and **daily_timing** becomes mandatory. - **false** - the break hour uses different timing for different days, and **custom_timing** becomes mandatory. |
Referenced models: Get a shift hour — response body — shift count, shift hours shift hours item break hours null item custom timing Lists per-day break timing overrides item
Get a shift hour — response body — shift count, shift hours shift hours item custom timing null item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Each object specifies the day of the week and the start and end time of the shift on that day. Additional keys: not allowed |
days | string | Required within parent | Represents the day of the week to which this custom shift timing applies. **Possible values**: - Monday - Tuesday - Wednesday - Thursday - Friday - Saturday - Sunday Maximum length: 100 |
shift_timing | array | Required within parent | Represents the start and end time of the shift on the specified day in `HH:MM` 24-hour format. Maximum items: 7 |
shift_timing[] | string | Each item | Each string represents the start time or end time of the window in `HH:MM` 24-hour format. Maximum length: 5 Pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$ |
Get a shift hour — response body — shift count, shift hours shift hours item holidays null item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Each object specifies the date and the name of the holiday. Additional keys: not allowed |
date | string | Required within parent | Represents the date of the holiday in `YYYY-MM-DD` format. Format: date |
id | string | Required within parent | Represents the unique identifier of the holiday. Maximum length: 100 |
name | string | Required within parent | Represents the name of the holiday. The name must not contain the special characters. Maximum length: 80 |
userFmt | string | Required within parent | Represents the holiday date formatted using the date format configured for the requesting user. Maximum length: 100 |
year | object | Required within parent | Represents the year of the holiday. Additional keys: not allowed |
Get a shift hour — response body — shift count, shift hours shift hours item users null item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Each object represents one user assigned to the shift hour, including the user details and the effective date of the assignment. Additional keys: not allowed |
effective_from | string | Required within parent | Represents the date from which the user assignment to the shift hour becomes effective, in `YYYY-MM-DD` format. The date must be in the future and must not be more than six months ahead of the current date. Format: date |
email | string | Required within parent | Represents the email address of the user assigned to the shift hour. Maximum length: 100 |
id | string | Required within parent | Represents the unique identifier of the user assigned to the shift hour. Maximum length: 100 |
name | string | Required within parent | Represents the full name of the user assigned to the shift hour. Maximum length: 100 |
role | object | Required within parent | Represents the role information of the user assigned to the shift hour. Additional keys: not allowed |
role.id | string | Required within parent | Represents the unique identifier of the role assigned to the user. Maximum length: 100 |
role.name | string | Required within parent | Represents the name of the role assigned to the user. Maximum length: 100 |
zuid | string | Required within parent | Represents the unique identifier of the user assigned to the shift hour. Maximum length: 100 |
Get a shift hour — response body — shift count, shift hours shift hours item break hours null item custom timing Lists per-day break timing overrides item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Each object specifies the day of the week and the start and end time of the break on that day. Additional keys: not allowed |
break_timing | array | Required within parent | Represents the start and end time of the break on the specified day in `HH:MM` 24-hour format. A break must be longer than 15 minutes and shorter than 2 hours. Maximum items: 7 |
break_timing[] | string | Each item | Each string represents the start time or end time of the window in `HH:MM` 24-hour format. Maximum length: 5 Pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$ |
days | string | Required within parent | Represents the day of the week to which this custom break timing applies. **Possible values**: - Monday - Tuesday - Wednesday - Thursday - Friday - Saturday - Sunday Maximum length: 100 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: zoho.getsingleshifthour. Catalog operation: getSingleShiftHour. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
No-content response statuses: [204]