Zoho crm Logo

获取班次时间

目的

获取为您的组织配置的轮班时间的详细信息。

端点

  • GET /settings/business_hours/shift_hours
  • GET /settings/business_hours/shift_hours/{shift_hour_id}

请求详情

请求 URL

获取所有班次时间: {api-domain}/crm/{version}/settings/business_hours/shift_hours
获取特定班次时间: {api-domain}/crm/{version}/settings/business_hours/shift_hours/{shift_hour_id}

标题

授权: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
X-CRM-ORG:{your_org_id}

范围

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

注意

  • 当"Users"在"Admin"配置文件中,并且那些具有"管理Users"权限的人获取特定的班次时间时,响应中将包含"Users"数组,数组中填充了用户的详细信息,如他们的电子邮件ID、ZUID、角色等。对于其他人,此键将持有值"null"。

示例请求

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

可能的错误

  • INVALID_DATAHTTP 400

    您要获取的班次小时的ID不正确。
    解决方法:提供正确的班次小时ID。

  • INVALID_REQUEST_METHODHTTP 404

    HTTP请求方法不正确。
    解决方法:使用GET方法来获取班次小时的详细信息。

  • OAUTH_SCOPE_MISMATCHHTTP 401

    您没有访问此API的正确范围。
    解决方法:使用ZohoCRM.settings.business_hours.ALL或ZohoCRM.settings.business_hours.READ范围创建新令牌。

  • NO_PERMISSIONHTTP 403

    您没有“管理Users”的权限。
    解决方法:联系您的管理员以获得执行此操作所需的权限。

示例响应

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"
                }
            ]
        }
    ]
}