> ## 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 Values

> Call this API to retrieve attendance report column values and column details by user ID, report column ID, and date range.

Call this API to get column value data from a DingTalk Smart Attendance report. The data includes all values of a report column within a specified time range, along with the related column information, for use by designated ISVs.

## API Call Description

* Attendance information of departed users is not available through this API. Query the attendance data of departed users in the [OA Admin Console](https://attend.dingtalk.io/portal/index.html).
* When you get the value of the "Required attendance days" field, this API only returns values within the last 15 days. For dates more than 15 days ago, the value of required attendance days is 0.

## Request

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

### Query Parameters

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

### Request Body

| Name | Type | Required | Example | Description |
| - | - | - | - | - |
| userid | String | Yes | manager4220 | The user ID of the user. |
| column\_id\_list | String | Yes | 129339038 | The report column ID. Call the [Get Attendance Report Column Definitions](https://help.dingtalk.io/open/development/queries-the-enterprise-attendance-report-column.md) API to obtain the id parameter value. Separate multiple values with commas. Maximum length: 20. |
| from\_date | Date | Yes | 2018-07-11 12:12:12 | The start time. |
| to\_date | Date | Yes | 2018-07-11 12:12:12 | The end time. The interval between the start time and the end time must be within 31 days. |

### Request Example

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/attendance/getcolumnval" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=4bfc0fxxxx3916c7' \
-d 'column_id_list=1%2C2%2C3' \
-d 'from_date=2018-07-11+12%3A12%3A12' \
-d 'to_date=2018-07-11+12%3A12%3A12' \
-d 'userid=zhangsan'
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/getcolumnval");
OapiAttendanceGetcolumnvalRequest req = new OapiAttendanceGetcolumnvalRequest();
req.setUserid("manager4220");
req.setColumnIdList("129339038");
req.setFromDate(StringUtils.parseDateTime("2020-09-07 12:12:12"));
req.setToDate(StringUtils.parseDateTime("2020-09-09 12:12:12"));
OapiAttendanceGetcolumnvalResponse 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.OapiAttendanceGetcolumnvalRequest("https://api.dingtalk.io/topapi/attendance/getcolumnval")

req.userid="zhangsan"
req.column_id_list="1,2,3"
req.from_date="2018-07-11 12:12:12"
req.to_date="2018-07-11 12:12:12"
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 OapiAttendanceGetcolumnvalRequest;
$req->setUserid("zhangsan");
$req->setColumnIdList("1,2,3");
$req->setFromDate("2018-07-11 12:12:12");
$req->setToDate("2018-07-11 12:12:12");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/getcolumnval");
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/getcolumnval");
OapiAttendanceGetcolumnvalRequest req = new OapiAttendanceGetcolumnvalRequest();
req.Userid = "zhangsan";
req.ColumnIdList = "1,2,3";
req.FromDate = DateTime.Parse("2018-07-11 12:12:12");
req.ToDate = DateTime.Parse("2018-07-11 12:12:12");
OapiAttendanceGetcolumnvalResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## Response

### Response Body

| Name | Type | Example | Description |
| - | - | - | - |
| request\_id | String | 45n2azecqj21 | The request ID. |
| errcode | Number | 0 | The return code. |
| result | ColumnValListForTopVo | | The returned result. |
| column\_vals | ColumnValForTopVo\[] | | The column information and column value data. |
| column\_vals | ColumnDayAndVal\[] | | The column value data. |
| date | Date | 2020-09-09 00:00:00 | The date. |
| value | String | 1.0 | The column value. |
| column\_vo | ColumnForTopVo | | The column information. |
| id | Number | 129339038 | The report column ID. |
| fixed\_value | String | 0 | The fixed value.  **Note**  Some report columns have fixed values. Their values are returned only in this field and not in column\_vals. |

### Response Body Example

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "errcode": 0,
  "result": {
    "column_vals": [
      {
        "column_vals": [
          {
            "date": "2020-09-07 00:00:00",
            "value": "1.0"
          },
          {
            "date": "2020-09-08 00:00:00",
            "value": "1.0"
          },
          {
            "date": "2020-09-09 00:00:00",
            "value": "1.0"
          }
        ],
        "column_vo": {
          "id": 129339038
        }
      }
    ]
  },
  "request_id": "45n2azecqj21"
}
```

### Error Codes

If an error occurs when you call this API, 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.