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

# Hapus shift

> Hapus shift absensi di DingTalk melalui API berdasarkan ID shift dan userId operator. Lihat parameter, contoh permintaan, dan format respons lengkap.

Panggil API ini untuk menghapus shift absensi berdasarkan ID shift.

## Permintaan

| **Informasi dasar** | |
| - | - |
| URL HTTP | [https://api.dingtalk.io/topapi/attendance/shift/delete](https://api.dingtalk.io/topapi/attendance/shift/delete) |
| Metode HTTP | POST |
| Tipe aplikasi yang didukung | appType-Aplikasi internal |
| Izin yang diperlukan | permission-qyapi\_attendance\_group\_manage-Izin kelola grup absensi |

### Parameter query

| Nama | Tipe | Wajib | Contoh | Deskripsi |
| - | - | - | - | - |
| access\_token | String | Ya | af21xxx | Kredensial aplikasi yang digunakan untuk memanggil API ini. Dapatkan dengan memanggil API [Mendapatkan access\_token Aplikasi internal](https://help.dingtalk.io/id/open/development/obtain-orgapp-token). |

### Isi permintaan

| Nama | Tipe | Wajib | Contoh | Deskripsi |
| - | - | - | - | - |
| op\_user\_id | String | Ya | user123 | userId operator. |
| shift\_id | Number | Ya | 2423 | ID shift. Dapatkan nilai parameter id dengan memanggil API [Mendapatkan ringkasan shift](https://help.dingtalk.io/id/open/development/enterprise-shift-query-in-batches.md). |

### Contoh permintaan

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/attendance/shift/delete" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=032bc0xxxxc460ee' \
-d 'op_user_id=abc' \
-d 'shift_id=2423'
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/shift/delete");
OapiAttendanceShiftDeleteRequest req = new OapiAttendanceShiftDeleteRequest();
req.setOpUserId("user456");
req.setShiftId(2423L);
OapiAttendanceShiftDeleteResponse 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.OapiAttendanceShiftDeleteRequest("https://api.dingtalk.io/topapi/attendance/shift/delete")

req.op_user_id="abc"
req.shift_id=2423
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 OapiAttendanceShiftDeleteRequest;
$req->setOpUserId("abc");
$req->setShiftId("2423");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/shift/delete");
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/shift/delete");
OapiAttendanceShiftDeleteRequest req = new OapiAttendanceShiftDeleteRequest();
req.OpUserId = "abc";
req.ShiftId = 2423L;
OapiAttendanceShiftDeleteResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## Respons

### Isi respons

| Nama | Tipe | Contoh | Deskripsi |
| - | - | - | - |
| errmsg | String | Error sistem | Pesan error yang dikembalikan jika panggilan gagal. |
| errcode | Number | 0 | Kode pengembalian. |
| success | Boolean | true | Menunjukkan apakah panggilan berhasil.   - **true**: Berhasil - **false**: Gagal |
| request\_id | String | 16apb7hw85jjw | ID permintaan. |

### Contoh isi respons

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "errcode": 0,
  "success": true,
  "request_id": "3lupjm5o0j7g"
}
```

### Kode error

Jika panggilan mengembalikan error, cari solusinya di dokumen [Kode error global](https://help.dingtalk.io/id/open/development/server-api-error-codes-1.md) berdasarkan pesan error.


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