> ## 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 Attendance Report Column Definitions

> Call this API to get smart attendance report column definitions, returning each column's ID, type, and name for selecting payroll columns.

Call this API to query the statistics of a column in the smart attendance report by column ID. Organizations can select which column values to use in payroll calculation.

## API Call Description

* This API does not return IDs for leave-related fields. To get leave-related data, call the [Get report leave data](https://help.dingtalk.io/open/development/obtains-the-holiday-data-from-the-smart-attendance-report.md) API.
* Make sure the smart statistics feature is turned on.

## Request

| **Basic information** | |
| - | - |
| HTTP URL | [https://api.dingtalk.io/topapi/attendance/getattcolumns](https://api.dingtalk.io/topapi/attendance/getattcolumns) |
| HTTP Method | POST |
| Supported app types | appType-Internal app　appType-Third-party enterprise app |
| Required permissions | permission-qyapi\_base-Basic permission required to call organization APIs |

### 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 through the [Get the access\_token of an Internal app](https://help.dingtalk.io/open/development/obtain-orgapp-token) API. - For a Third-party enterprise app, obtain it through the Get the access\_token of a third-party organization API. |

### Request Example

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/attendance/getattcolumns" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=1aae6dxxxx7bf36'
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/getattcolumns");
OapiAttendanceGetattcolumnsRequest req = new OapiAttendanceGetattcolumnsRequest();
OapiAttendanceGetattcolumnsResponse 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.OapiAttendanceGetattcolumnsRequest("https://api.dingtalk.io/topapi/attendance/getattcolumns")

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 OapiAttendanceGetattcolumnsRequest;
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/getattcolumns");
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/getattcolumns");
OapiAttendanceGetattcolumnsRequest req = new OapiAttendanceGetattcolumnsRequest();
OapiAttendanceGetattcolumnsResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## Response

### Response Body

| Name | Type | Example | Description |
| - | - | - | - |
| request\_id | String | emhw3318cdhv | The request ID. |
| errcode | Number | 0 | The return code. |
| result | AttColumnsForTopVo | | The query result. |
| columns | ColumnForTopVo\[] | | The report column information. |
| id | Number | 123 | The report column ID. |
| type | Number | 0 | The report column type. |
| name | String | Working hours | The report column name. |
| alias | String | 3\_on\_duty\_user\_check\_result | The report column alias. |
| status | Number | 0 | The status of the report column. |
| sub\_type | Number | 0 | The subtype. |
| expression\_id | Number | 129334038 | Deprecated field. Do not use this field in business logic. |

### Response Body Example

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "errcode": 0,
  "result": {
    "columns": [
      {
        "alias": "should_attendance_days",
        "expression_id": 129334038,
        "id": 129339038,
        "name": "Required attendance days",
        "status": 0,
        "sub_type": 0,
        "type": 0
      },
      {
        "alias": "making_up_lack_times",
        "expression_id": 129334039,
        "id": 129339039,
        "name": "Makeup clock-in count",
        "status": 0,
        "sub_type": 0,
        "type": 0
      }
    ]
  },
  "request_id": "10stq4mcre2wu"
}
```

### Error Codes

If a call to this API fails, 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.


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