> ## 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 Shift Summaries

> Call this API to query summaries of all attendance shifts in an organization by operator userId and cursor-based pagination.

Call this API to query all shifts. In the DingTalk Attendance app, a shift is a set of rules, such as clock-in times and break times. Organizations can configure multiple shifts based on their business needs.

## Request

| **Basic Information** | |
| - | - |
| HTTP URL | [https://api.dingtalk.io/topapi/attendance/shift/list](https://api.dingtalk.io/topapi/attendance/shift/list) |
| HTTP Method | POST |
| Supported app types | appType-Internal app　appType-Third-party enterprise app |
| Permissions | permission-qyapi\_attendance\_group\_read-Attendance group read permission |

### Query Parameters

| Name | Type | Required | Example | Description |
| - | - | - | - | - |
| access\_token | String | Yes | bE74xxxx | The app credential used to call this API.   - For an Internal app, obtain it by calling [Get the access\_token of an Internal App](https://help.dingtalk.io/open/development/obtain-orgapp-token). - For a Third-party enterprise app, obtain it by calling the API for getting the access\_token of a third-party organization. |

### Request Body

| Name | Type | Required | Example | Description |
| - | - | - | - | - |
| op\_user\_id | String | Yes | manager4220 | The userId of the operator. |
| cursor | Number | No | 0 | The cursor ID. The initial value is 0. |

### Request Example

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/attendance/shift/list" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=e47ef3ff-ff01-4da7-8aa8-53bc0ad47be3' \
-d 'cursor=1234' \
-d 'op_user_id=dd_test'
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/shift/list");
OapiAttendanceShiftListRequest req = new OapiAttendanceShiftListRequest();
req.setOpUserId("dd_test");
req.setCursor(0L);
OapiAttendanceShiftListResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
```

Python

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import dingtalk.api

req=dingtalk.api.OapiAttendanceShiftListRequest("https://api.dingtalk.io/topapi/attendance/shift/list")

req.op_user_id="dd_test"
req.cursor=1234
try:
	resp= req.getResponse(access_token)
	print(resp)
except Exception,e:
	print(e)
```

PHP

```php theme={"theme":{"light":"github-light","dark":"github-dark"}}
include "TopSdk.php";
date_default_timezone_set('Asia/Shanghai');

$c = new DingTalkClient(DingTalkConstant::$CALL_TYPE_OAPI, DingTalkConstant::$METHOD_POST , DingTalkConstant::$FORMAT_JSON);
$req = new OapiAttendanceShiftListRequest;
$req->setOpUserId("dd_test");
$req->setCursor("1234");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/shift/list");
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/shift/list");
OapiAttendanceShiftListRequest req = new OapiAttendanceShiftListRequest();
req.OpUserId = "dd_test";
req.Cursor = 1234L;
OapiAttendanceShiftListResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## Response

### Response Body

| Name | Type | Example | Description |
| - | - | - | - |
| result | PageResult | | The query result. |
| has\_more | Boolean | false | Whether more data is available.   - **true**: Yes - **false**: No |
| cursor | Number | 678215070 | The cursor position of the next page. |
| result | TopMinimalismShiftVo\[] | | The shift information.  Each page returns 200 records. Results with more than 200 records are paginated. |
| name | String | A | The shift name. |
| id | Number | 677995086 | The shift ID. |
| success | Boolean | true | Whether the request succeeded.   - **true**: Success - **false**: Failed |
| errcode | Number | 0 | The return code. |
| errmsg | String | ok | The description of the return code. |
| request\_id | String | 1079sd06ne6zy | The request ID. |

### Response Body Example

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "errcode": 0,
  "errmsg":"ok",
  "result": {
    "cursor": 678215070,
    "has_more": false,
    "result": [
      {
        "id": 677995086,
        "name": "A"
      },
      {
        "id": 678215070,
        "name": "B"
      }
    ]
  },
  "success": true,
  "request_id": "1079sd06ne6zy"
}
```

### Error Codes

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


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