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

# 勤怠グループ概要の検索

> 勤怠グループ名のあいまい検索で、該当するグループの名前と ID を取得する API です。パラメータやリクエスト・レスポンス例も紹介します。

この API を呼び出すと、名前で勤怠グループをあいまい検索し、勤怠グループの概要を取得できます。概要には勤怠グループ名と ID が含まれます。

## リクエスト

| **ベーシック情報** | |
| - | - |
| HTTP URL | [https://api.dingtalk.io/topapi/attendance/group/search](https://api.dingtalk.io/topapi/attendance/group/search) |
| HTTP メソッド | POST |
| 対応アプリタイプ | appType-社内アプリ　appType-サードパーティ社内アプリ |
| 必要な権限 | permission-qyapi\_attendance\_group\_read-勤怠グループの読み取り権限 |

### クエリパラメータ

| 名前 | タイプ | 必須 | 例 | 説明 |
| - | - | - | - | - |
| access\_token | String | はい | bE74xxxx | この API の呼び出しに使用するアプリ認証情報です。   - 社内アプリ：[社内アプリの access\_token を取得](https://help.dingtalk.io/ja/open/development/obtain-orgapp-token) API を呼び出して取得します。 - サードパーティ社内アプリ：サードパーティ組織の access\_token を取得 API を呼び出して取得します。 |

### リクエストボディ

| 名前 | タイプ | 必須 | 例 | 説明 |
| - | - | - | - | - |
| op\_user\_id | String | はい | manager123 | 操作者の userId です。 |
| group\_name | String | はい | 勤怠 | 勤怠グループ名です。 |

### リクエスト例

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/attendance/group/search" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=d7689axxxx70e7a' \
-d 'group_name=%Exxxx%BA%97' \
-d 'op_user_id=dd_dd'
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/search");
OapiAttendanceGroupSearchRequest req = new OapiAttendanceGroupSearchRequest();
req.setOpUserId("manager123");
req.setGroupName("勤怠");
OapiAttendanceGroupSearchResponse 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.OapiAttendanceGroupSearchRequest("https://api.dingtalk.io/topapi/attendance/group/search")

req.op_user_id="dd_dd"
req.group_name="渋谷店"
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 OapiAttendanceGroupSearchRequest;
$req->setOpUserId("dd_dd");
$req->setGroupName("渋谷店");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/group/search");
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/search");
OapiAttendanceGroupSearchRequest req = new OapiAttendanceGroupSearchRequest();
req.OpUserId = "dd_dd";
req.GroupName = "渋谷店";
OapiAttendanceGroupSearchResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## レスポンス

### レスポンスボディ

| 名前 | タイプ | 例 | 説明 |
| - | - | - | - |
| result | TopMinimalismGroupVO\[] | | クエリ結果です。 |
| name | String | 勤怠 | 勤怠グループ名です。 |
| id | Number | 685935028 | 勤怠グループ ID です。 |
| success | Boolean | true | クエリが成功したかどうかを示します。   - **true**：成功 - **false**：失敗 |
| errcode | Number | 0 | リターンコードです。 |
| request\_id | String | 750mu3wy9fu | リクエスト ID です。 |

### レスポンスボディの例

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "errcode": 0,
  "result": [
    {
      "id": 685935028,
      "name": "勤怠"
    }
  ],
  "success": true,
  "request_id": "750muu3wy9fu"
}
```

### エラーコード

この API の呼び出しでエラーが返された場合は、エラーメッセージを基に[グローバルエラーコード](https://help.dingtalk.io/ja/open/development/server-api-error-codes-1.md)ドキュメントで解決方法を確認してください。


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