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

# 勤怠グループの削除

> group_key を指定して勤怠グループを削除する API です。必要な権限、リクエストパラメータ、各言語のリクエスト例、レスポンス内容を確認できます。

## リクエスト

| **基本情報** | |
| - | - |
| HTTP URL | [https://api.dingtalk.io/topapi/attendance/group/delete](https://api.dingtalk.io/topapi/attendance/group/delete) |
| HTTP メソッド | POST |
| サポートされるアプリタイプ | appType-社内アプリ |
| 必要な権限 | permission-qyapi\_attendance\_group\_manage-勤怠グループ管理権限 |

### クエリパラメータ

| 名前 | タイプ | 必須 | 例 | 説明 |
| - | - | - | - | - |
| access\_token | String | はい | 4c9ebd2xxxx | この API を呼び出すためのアプリ認証情報です。[社内アプリの access\_token を取得](https://help.dingtalk.io/ja/open/development/obtain-orgapp-token) API を呼び出して取得してください。 |

### リクエストボディ

| 名前 | タイプ | 必須 | 例 | 説明 |
| - | - | - | - | - |
| op\_userid | String | いいえ | user01 | 操作者のユーザー ID です。 |
| group\_key | String | はい | 0151E02xxxx | 勤怠グループの ID です。 **注記** group\_id で勤怠グループを識別している場合は、[groupId を groupKey に変換](https://help.dingtalk.io/ja/open/development/groupid-to-groupkey.md) API を呼び出して、group\_id を group\_key に変換してください。 |

### リクエスト例

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/attendance/group/delete" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=0d5exxxxf31e2da' \
-d 'group_key=0151E02xxxx1A917E876' \
-d 'op_userid=123456'
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/delete");
OapiAttendanceGroupDeleteRequest req = new OapiAttendanceGroupDeleteRequest();
req.setOpUserid("user01");
req.setGroupKey("0151E02xxxx");
OapiAttendanceGroupDeleteResponse 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.OapiAttendanceGroupDeleteRequest("https://api.dingtalk.io/topapi/attendance/group/delete")

req.op_userid="123456"
req.group_key="0151Exxxx7E876"
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 OapiAttendanceGroupDeleteRequest;
$req->setOpUserid("123456");
$req->setGroupKey("0151Exxxx17E876");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/group/delete");
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/delete");
OapiAttendanceGroupDeleteRequest req = new OapiAttendanceGroupDeleteRequest();
req.OpUserid = "123456";
req.GroupKey = "0151E0xxxxE876";
OapiAttendanceGroupDeleteResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## レスポンス

### レスポンスボディ

| 名前 | タイプ | 例 | 説明 |
| - | - | - | - |
| result | String | BE8C35586xxxx | 勤怠グループの ID です。 |
| success | Boolean | true | 呼び出しに成功したかどうかを示します。   - **true**：成功 - **false**：失敗 |
| errmsg | String | ok | 戻りコードの説明です。 |
| errcode | Number | 0 | 戻りコードです。 |
| request\_id | String | 3x1mikbgn3ca | リクエスト ID です。 |

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

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "errcode": 0,
    "errmsg":"ok",
    "result": "BE8C35586xxxx",
    "success": true,
    "request_id": "3x1mikbgn3ca"
}
```

### エラーコード

この 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.