Get Shift Hours

Purpose

To get the details of the shift hours configured for your organization.

Request Details

Request URL

To get all shift hours: {api-domain}/crm/{version}/settings/business_hours/shift_hours
To get a specific shift hour: {api-domain}/crm/{version}/settings/business_hours/shift_hours/{shift_hour_id}

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
X-CRM-ORG:{your_org_id}

Scope

scope=ZohoCRM.settings.business_hours.ALL
(or)
scope=ZohoCRM.settings.business_hours.READ

Note

  • When users in the "Admin" profile and those with "Manage Users" permission fetch a specific shift hour, the response will have the "users" array populated with the details of the user such as their email ID, ZUID, role etc,. For others, this key will hold the value "null".

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v6/settings/business_hours/shift_hours/3652397000011179005"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-H "X-CRM-ORG:{your_org_id}"
-X GET

Possible Errors

  • INVALID_DATAHTTP 400

    The ID of the shift hour you want to fetch is incorrect.
    Resolution: Give the right ID of the shift hour.

  • INVALID_REQUEST_METHODHTTP 404

    The HTTP request method is incorrect.
    Resolution: The HTTP method is GET to fetch the details of a shift hour.

  • OAUTH_SCOPE_MISMATCHHTTP 401

    You do not have the right scope to access this API.
    Resolution: Create new token with ZohoCRM.settings.business_hours.ALL or ZohoCRM.settings.business_hours.READ scopes.

  • NO_PERMISSIONHTTP 403

    You d not have the "Manage Users" permission.
    Resolution: Contact your administrator to obtain the necessary permission to perform this action.

Sample Response

Copied{
    "shift_count": {
        "total_shift_with_user": 2,
        "total_shift": 15
    },
    "shift_hours": [
        {
            "custom_timing": null,
            "users_count": 1,
            "holidays": null,
            "daily_timing": [
                "10:00",
                "17:00"
            ],
            "timezone": "Etc/GMT+12",
            "name": "shift hours with holiday11",
            "break_hours": null,
            "shift_days": [
                "Monday"
            ],
            "same_as_everyday": true,
            "id": "3652397000011179005",
            "users": [
                {
                    "role": {
                        "name": "null",
                        "id": "null"
                    },
                    "name": "patboyle",
                    "id": "3652397000001464001",
                    "effective_from": "2023-04-23",
                    "email": "patboyle@gmail.com",
                    "zuid": "698789031"
                }
            ]
        }
    ]
}