> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a Paginated List of Overtime Rules

> Call this API to get a paginated list of overtime rules by page number and page size. The response includes each rule's name and ID.

Call this API to get a paginated list of overtime rules configured in attendance clock-in settings, including each rule's name and ID.

## API Call Description

For example, suppose your organization's attendance rules management contains three overtime rules: **Calculate overtime by clock-in time after approval**, **Calculate overtime by approval time**, and **Calculate overtime by clock-in time**.

Call this API to get the rule name and rule ID of all three overtime rules.

Overtime rules are managed under **Attendance Rules Management** > **Overtime Rules**, where you can add a rule via **Add Overtime Rule** and **Edit** or **Delete** existing ones. The three example rules behave as follows:

| Rule name | Content (workday / rest day / holiday) | Application scope |
| - | - | - |
| Calculate overtime by approval time | Overtime must be approved; overtime duration is based on the approval form | Entire company (except those with other overtime rules) |
| Calculate overtime by clock-in time after approval | Overtime must be approved; based on clock-in, but cannot exceed the approval form duration | Not in use |
| Calculate overtime by clock-in time | Overtime requires no approval; overtime duration is calculated from clock-in time | Not in use |

## Request

### Basic Information

| Field | Value |
| - | - |
| HTTP URL | [https://api.dingtalk.io/v1.0/attendance/overtimeSettings](https://api.dingtalk.io/v1.0/attendance/overtimeSettings) |
| HTTP Method | GET |
| Supported app types | appType-Internal app　appType-Third-party enterprise app |
| Required permissions | permission-qyapi\_attendance\_group\_read-Attendance group read permission |

### Request Header

| Name | Type | Required | Description |
| - | - | - | - |
| x-acs-dingtalk-access-token | String | Yes | The access credential for calling this API. Obtain it as follows:   - Internal app: Call the [Get the access token of an internal app](https://help.dingtalk.io/open/development/obtain-the-access-token-of-an-internal-app.md) API. - Third-party enterprise app: Call the API for getting the access token of an organization that has authorized a third-party app. |

### Query Parameters

| Name | Type | Required | Description |
| - | - | - | - |
| pageNumber | Long | Yes | The starting page number.  The value starts from 1. |
| pageSize | Long | Yes | The page size.  The maximum value is 50. |

### Request Example

HTTP

```http theme={"theme":{"light":"github-light","dark":"github-dark"}}
GET /v1.0/attendance/overtimeSettings?pageNumber=1&pageSize=10 HTTP/1.1
Host:api.dingtalk.io
x-acs-dingtalk-access-token:xxxxx
Content-Type:application/json
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.sample;

import com.aliyun.tea.*;

public class Sample {

    /**
     * Initialize the account Client with a Token
     * @return Client
     * @throws Exception
     */
    public static com.aliyun.dingtalkattendance_1_0.Client createClient() throws Exception {
        com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config();
        config.protocol = "https";
        config.regionId = "central";
        return new com.aliyun.dingtalkattendance_1_0.Client(config);
    }

    public static void main(String[] args_) throws Exception {
        java.util.List<String> args = java.util.Arrays.asList(args_);
        com.aliyun.dingtalkattendance_1_0.Client client = Sample.createClient();
        com.aliyun.dingtalkattendance_1_0.models.GetSimpleOvertimeSettingHeaders getSimpleOvertimeSettingHeaders = new com.aliyun.dingtalkattendance_1_0.models.GetSimpleOvertimeSettingHeaders();
        getSimpleOvertimeSettingHeaders.xAcsDingtalkAccessToken = "<your access token>";
        com.aliyun.dingtalkattendance_1_0.models.GetSimpleOvertimeSettingRequest getSimpleOvertimeSettingRequest = new com.aliyun.dingtalkattendance_1_0.models.GetSimpleOvertimeSettingRequest()
                .setPageNumber(1L)
                .setPageSize(10L);
        try {
            client.getSimpleOvertimeSettingWithOptions(getSimpleOvertimeSettingRequest, getSimpleOvertimeSettingHeaders, new com.aliyun.teautil.models.RuntimeOptions());
        } catch (TeaException err) {
            if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
                // err contains the code and message attributes to help you troubleshoot the issue
            }

        } catch (Exception _err) {
            TeaException err = new TeaException(_err.getMessage(), _err);
            if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
                // err contains the code and message attributes to help you troubleshoot the issue
            }

        }        
    }
}
```

Python

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
import sys

from typing import List

from alibabacloud_dingtalk.attendance_1_0.client import Client as dingtalkattendance_1_0Client
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_dingtalk.attendance_1_0 import models as dingtalkattendance__1__0_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_tea_util.client import Client as UtilClient

class Sample:
    def __init__(self):
        pass

    @staticmethod
    def create_client() -> dingtalkattendance_1_0Client:
        """
        Initialize the account Client with a Token
        @return: Client
        @throws Exception
        """
        config = open_api_models.Config()
        config.protocol = 'https'
        config.region_id = 'central'
        return dingtalkattendance_1_0Client(config)

    @staticmethod
    def main(
        args: List[str],
    ) -> None:
        client = Sample.create_client()
        get_simple_overtime_setting_headers = dingtalkattendance__1__0_models.GetSimpleOvertimeSettingHeaders()
        get_simple_overtime_setting_headers.x_acs_dingtalk_access_token = '<your access token>'
        get_simple_overtime_setting_request = dingtalkattendance__1__0_models.GetSimpleOvertimeSettingRequest(
            page_number=1,
            page_size=10
        )
        try:
            client.get_simple_overtime_setting_with_options(get_simple_overtime_setting_request, get_simple_overtime_setting_headers, util_models.RuntimeOptions())
        except Exception as err:
            if not UtilClient.empty(err.code) and not UtilClient.empty(err.message):
                # err contains the code and message attributes to help you troubleshoot the issue
                pass

    @staticmethod
    async def main_async(
        args: List[str],
    ) -> None:
        client = Sample.create_client()
        get_simple_overtime_setting_headers = dingtalkattendance__1__0_models.GetSimpleOvertimeSettingHeaders()
        get_simple_overtime_setting_headers.x_acs_dingtalk_access_token = '<your access token>'
        get_simple_overtime_setting_request = dingtalkattendance__1__0_models.GetSimpleOvertimeSettingRequest(
            page_number=1,
            page_size=10
        )
        try:
            await client.get_simple_overtime_setting_with_options_async(get_simple_overtime_setting_request, get_simple_overtime_setting_headers, util_models.RuntimeOptions())
        except Exception as err:
            if not UtilClient.empty(err.code) and not UtilClient.empty(err.message):
                # err contains the code and message attributes to help you troubleshoot the issue
                pass

if __name__ == '__main__':
    Sample.main(sys.argv[1:])
```

PHP

```php theme={"theme":{"light":"github-light","dark":"github-dark"}}
<?php

// This file is auto-generated, don't edit it. Thanks.
namespace AlibabaCloud\SDK\Sample;

use AlibabaCloud\SDK\Dingtalk\Vattendance_1_0\Dingtalk;
use \Exception;
use AlibabaCloud\Tea\Exception\TeaError;
use AlibabaCloud\Tea\Utils\Utils;

use Darabonba\OpenApi\Models\Config;
use AlibabaCloud\SDK\Dingtalk\Vattendance_1_0\Models\GetSimpleOvertimeSettingHeaders;
use AlibabaCloud\SDK\Dingtalk\Vattendance_1_0\Models\GetSimpleOvertimeSettingRequest;
use AlibabaCloud\Tea\Utils\Utils\RuntimeOptions;

class Sample {

    /**
     * Initialize the account Client with a Token
     * @return Dingtalk Client
     */
    public static function createClient(){
        $config = new Config([]);
        $config->protocol = "https";
        $config->regionId = "central";
        return new Dingtalk($config);
    }

    /**
     * @param string[] $args
     * @return void
     */
    public static function main($args){
        $client = self::createClient();
        $getSimpleOvertimeSettingHeaders = new GetSimpleOvertimeSettingHeaders([]);
        $getSimpleOvertimeSettingHeaders->xAcsDingtalkAccessToken = "<your access token>";
        $getSimpleOvertimeSettingRequest = new GetSimpleOvertimeSettingRequest([
            "pageNumber" => 1,
            "pageSize" => 10
        ]);
        try {
            $client->getSimpleOvertimeSettingWithOptions($getSimpleOvertimeSettingRequest, $getSimpleOvertimeSettingHeaders, new RuntimeOptions([]));
        }
        catch (Exception $err) {
            if (!($err instanceof TeaError)) {
                $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
            }
            if (!Utils::empty_($err->code) && !Utils::empty_($err->message)) {
                // err contains the code and message attributes to help you troubleshoot the issue
            }
        }
    }
}
$path = __DIR__ . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php';
if (file_exists($path)) {
    require_once $path;
}
Sample::main(array_slice($argv, 1));
```

Go

```go theme={"theme":{"light":"github-light","dark":"github-dark"}}
// This file is auto-generated, don't edit it. Thanks.
package main

import (
  "os"
  util  "github.com/alibabacloud-go/tea-utils/v2/service"
  dingtalkattendance_1_0  "github.com/alibabacloud-go/dingtalk/attendance_1_0"
  openapi  "github.com/alibabacloud-go/darabonba-openapi/v2/client"
  "github.com/alibabacloud-go/tea/tea"
)

/**
 * Initialize the account Client with a Token
 * @return Client
 * @throws Exception
 */
func CreateClient () (_result *dingtalkattendance_1_0.Client, _err error) {
  config := &openapi.Config{}
  config.Protocol = tea.String("https")
  config.RegionId = tea.String("central")
  _result = &dingtalkattendance_1_0.Client{}
  _result, _err = dingtalkattendance_1_0.NewClient(config)
  return _result, _err
}

func _main (args []*string) (_err error) {
  client, _err := CreateClient()
  if _err != nil {
    return _err
  }

  getSimpleOvertimeSettingHeaders := &dingtalkattendance_1_0.GetSimpleOvertimeSettingHeaders{}
  getSimpleOvertimeSettingHeaders.XAcsDingtalkAccessToken = tea.String("<your access token>")
  getSimpleOvertimeSettingRequest := &dingtalkattendance_1_0.GetSimpleOvertimeSettingRequest{
    PageNumber: tea.Int64(1),
    PageSize: tea.Int64(10),
  }
  tryErr := func()(_e error) {
    defer func() {
      if r := tea.Recover(recover()); r != nil {
        _e = r
      }
    }()
    _, _err = client.GetSimpleOvertimeSettingWithOptions(getSimpleOvertimeSettingRequest, getSimpleOvertimeSettingHeaders, &util.RuntimeOptions{})
    if _err != nil {
      return _err
    }

    return nil
  }()

  if tryErr != nil {
    var err = &tea.SDKError{}
    if _t, ok := tryErr.(*tea.SDKError); ok {
      err = _t
    } else {
      err.Message = tea.String(tryErr.Error())
    }
    if !tea.BoolValue(util.Empty(err.Code)) && !tea.BoolValue(util.Empty(err.Message)) {
      // err contains the code and message attributes to help you troubleshoot the issue
    }

  }
  return _err
}

func main() {
  err := _main(tea.StringSlice(os.Args[1:]))
  if err != nil {
    panic(err)
  }
}
```

Node.js

```typescript theme={"theme":{"light":"github-light","dark":"github-dark"}}
// This file is auto-generated, don't edit it
import Util, * as $Util from '@alicloud/tea-util';
import dingtalkattendance_1_0, * as $dingtalkattendance_1_0 from '@alicloud/dingtalk/attendance_1_0';
import OpenApi, * as $OpenApi from '@alicloud/openapi-client';
import * as $tea from '@alicloud/tea-typescript';

export default class Client {

  /**
   * Initialize the account Client with a Token
   * @return Client
   * @throws Exception
   */
  static createClient(): dingtalkattendance_1_0 {
    let config = new $OpenApi.Config({ });
    config.protocol = "https";
    config.regionId = "central";
    return new dingtalkattendance_1_0(config);
  }

  static async main(args: string[]): Promise<void> {
    let client = Client.createClient();
    let getSimpleOvertimeSettingHeaders = new $dingtalkattendance_1_0.GetSimpleOvertimeSettingHeaders({ });
    getSimpleOvertimeSettingHeaders.xAcsDingtalkAccessToken = "<your access token>";
    let getSimpleOvertimeSettingRequest = new $dingtalkattendance_1_0.GetSimpleOvertimeSettingRequest({
      pageNumber: 1,
      pageSize: 10,
    });
    try {
      await client.getSimpleOvertimeSettingWithOptions(getSimpleOvertimeSettingRequest, getSimpleOvertimeSettingHeaders, new $Util.RuntimeOptions({ }));
    } catch (err) {
      if (!Util.empty(err.code) && !Util.empty(err.message)) {
        // err contains the code and message attributes to help you troubleshoot the issue
      }

    }    
  }

}

Client.main(process.argv.slice(2));
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
// This file is auto-generated, don't edit it. Thanks.

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;

using Tea;
using Tea.Utils;

namespace AlibabaCloud.SDK.Sample
{
    public class Sample 
    {

        /**
         * Initialize the account Client with a Token
         * @return Client
         * @throws Exception
         */
        public static AlibabaCloud.SDK.Dingtalkattendance_1_0.Client CreateClient()
        {
            AlibabaCloud.OpenApiClient.Models.Config config = new AlibabaCloud.OpenApiClient.Models.Config();
            config.Protocol = "https";
            config.RegionId = "central";
            return new AlibabaCloud.SDK.Dingtalkattendance_1_0.Client(config);
        }

        public static void Main(string[] args)
        {
            AlibabaCloud.SDK.Dingtalkattendance_1_0.Client client = CreateClient();
            AlibabaCloud.SDK.Dingtalkattendance_1_0.Models.GetSimpleOvertimeSettingHeaders getSimpleOvertimeSettingHeaders = new AlibabaCloud.SDK.Dingtalkattendance_1_0.Models.GetSimpleOvertimeSettingHeaders();
            getSimpleOvertimeSettingHeaders.XAcsDingtalkAccessToken = "<your access token>";
            AlibabaCloud.SDK.Dingtalkattendance_1_0.Models.GetSimpleOvertimeSettingRequest getSimpleOvertimeSettingRequest = new AlibabaCloud.SDK.Dingtalkattendance_1_0.Models.GetSimpleOvertimeSettingRequest
            {
                PageNumber = 1,
                PageSize = 10,
            };
            try
            {
                client.GetSimpleOvertimeSettingWithOptions(getSimpleOvertimeSettingRequest, getSimpleOvertimeSettingHeaders, new AlibabaCloud.TeaUtil.Models.RuntimeOptions());
            }
            catch (TeaException err)
            {
                if (!AlibabaCloud.TeaUtil.Common.Empty(err.Code) && !AlibabaCloud.TeaUtil.Common.Empty(err.Message))
                {
                    // err contains the code and message attributes to help you troubleshoot the issue
                }
            }
            catch (Exception _err)
            {
                TeaException err = new TeaException(new Dictionary<string, object>
                {
                    { "message", _err.Message }
                });
                if (!AlibabaCloud.TeaUtil.Common.Empty(err.Code) && !AlibabaCloud.TeaUtil.Common.Empty(err.Message))
                {
                    // err contains the code and message attributes to help you troubleshoot the issue
                }
            }
        }

    }
}
```

## Response

### Response Body

| Name | Type | Description |
| - | - | - |
| result | Object | The returned result. |
| pageNumber | Long | The current page number. |
| totalPage | Long | The total number of pages. |
| items | Array | The list of overtime rules. |
| id | Long | The overtime rule ID. |
| name | String | The overtime rule name. |
| settingId | Long | The settingId of the overtime rule. |

### Response Body Example

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
HTTP/1.1 200 OK
Content-Type:application/json

{
  "result" : {
    "pageNumber" : 1,
    "totalPage" : 10,
    "items" : [ {
      "id" : 221375127,
      "name" : "Calculate overtime by approval time",
      "settingId" : 221375127
    } ]
  }
}
```

### Error Codes

If the API call returns an error, find a solution in the [Global error codes](https://help.dingtalk.io/open/development/server-api-error-codes-1.md) document based on the error message.

| HttpCode | Error code | Error message | Description |
| - | - | - | - |
| 400 | system.error | System error | System error |
| 400 | paging.parameter.error | Pagination parameter error | Pagination parameter error |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.