> ## 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 を指定し、打刻場所や打刻用 Wi-Fi などの追加情報を設定する API です。既存の打刻設定を保持するかどうかも指定できます。

この API を呼び出して、打刻場所や打刻用 Wi-Fi などのシフト情報を設定します。

## リクエスト

### 基本情報

| フィールド | 値 |
| - | - |
| HTTP URL | [https://api.dingtalk.io/v1.0/attendance/schedules/additionalInfo](https://api.dingtalk.io/v1.0/attendance/schedules/additionalInfo) |
| HTTP メソッド | PUT |
| サポートされるアプリタイプ | appType-社内アプリ |
| 必須の権限 | permission-Pro.AttendanceGroup.Write-勤怠グループ情報の書き込み権限 |

### リクエストヘッダー

| 名前 | タイプ | 必須 | 説明 |
| - | - | - | - |
| x-acs-dingtalk-access-token | String | はい | この API を呼び出すためのアクセス認証情報です。[社内アプリのアクセストークンを取得](https://help.dingtalk.io/ja/open/development/obtain-the-access-token-of-an-internal-app.md) を呼び出して取得します。 |

### リクエストボディ

| 名前 | タイプ | 必須 | 説明 |
| - | - | - | - |
| scheduleInfos | Array | はい | シフト情報のリストです。 |
| planId | Long | はい | 更新するシフトの ID です。[組織の勤怠シフト詳細を照会](https://help.dingtalk.io/ja/open/development/interface-for-daily-full-query-of-attendance-scheduling-information.md) を呼び出して取得します。 |
| wifiKeys | Array of String | いいえ | 追加する Wi-Fi のリストです。 |
| positionKeys | Array of String | いいえ | 追加する場所のリストです。 |
| retainAttendanceCheck | Boolean | いいえ | 勤怠の打刻設定を保持するかどうかを指定します。 |
| opUserId | String | はい | 操作者のユーザー ID です。 |

### リクエスト例

HTTP

```http theme={"theme":{"light":"github-light","dark":"github-dark"}}
PUT /v1.0/attendance/schedules/additionalInfo HTTP/1.1
Host:api.dingtalk.io
x-acs-dingtalk-access-token:1d97cxxx
Content-Type:application/json

{
  "scheduleInfos" : [ {
    "planId" : 12345,
    "wifiKeys" : [ "CA9B334xxx" ],
    "positionKeys" : [ "CA9B334xxx" ],
    "retainAttendanceCheck" : false
  } ],
  "opUserId" : "userid123"
}
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
// このファイルは自動生成されています。編集しないでください。
package com.aliyun.sample;

import com.aliyun.tea.*;

public class Sample {

    /**
     * Token を使用してアカウント Client を初期化します
     * @return Client
     * @throws Exception
     */
    public static com.aliyun.dingtalkattendance_1_0.Client createClient() throws Exception {
        com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config();
        config.protocol = "https";
        config.regionId = "central";
        return new com.aliyun.dingtalkattendance_1_0.Client(config);
    }

    public static void main(String[] args_) throws Exception {
        java.util.List<String> args = java.util.Arrays.asList(args_);
        com.aliyun.dingtalkattendance_1_0.Client client = Sample.createClient();
        com.aliyun.dingtalkattendance_1_0.models.SyncScheduleInfoHeaders syncScheduleInfoHeaders = new com.aliyun.dingtalkattendance_1_0.models.SyncScheduleInfoHeaders();
        syncScheduleInfoHeaders.xAcsDingtalkAccessToken = "<your access token>";
        com.aliyun.dingtalkattendance_1_0.models.SyncScheduleInfoRequest.SyncScheduleInfoRequestScheduleInfos scheduleInfos0 = new com.aliyun.dingtalkattendance_1_0.models.SyncScheduleInfoRequest.SyncScheduleInfoRequestScheduleInfos()
                .setPlanId(12345L)
                .setWifiKeys(java.util.Arrays.asList(
                    "CA9B334xxx"
                ))
                .setPositionKeys(java.util.Arrays.asList(
                    "CA9B334xxx"
                ))
                .setRetainAttendanceCheck(false);
        com.aliyun.dingtalkattendance_1_0.models.SyncScheduleInfoRequest syncScheduleInfoRequest = new com.aliyun.dingtalkattendance_1_0.models.SyncScheduleInfoRequest()
                .setScheduleInfos(java.util.Arrays.asList(
                    scheduleInfos0
                ))
                .setOpUserId("userid123");
        try {
            client.syncScheduleInfoWithOptions(syncScheduleInfoRequest, syncScheduleInfoHeaders, new com.aliyun.teautil.models.RuntimeOptions());
        } catch (TeaException err) {
            if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
                // err には code 属性と message 属性が含まれており、問題のトラブルシューティングに役立ちます
            }

        } catch (Exception _err) {
            TeaException err = new TeaException(_err.getMessage(), _err);
            if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
                // err には code 属性と message 属性が含まれており、問題のトラブルシューティングに役立ちます
            }

        }        
    }
}
```

Python

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
# -*- coding: utf-8 -*-
# このファイルは自動生成されています。編集しないでください。
import os
import sys

from typing import List

from alibabacloud_dingtalk.attendance_1_0.client import Client as dingtalkattendance_1_0Client
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_dingtalk.attendance_1_0 import models as dingtalkattendance__1__0_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_tea_util.client import Client as UtilClient

class Sample:
    def __init__(self):
        pass

    @staticmethod
    def create_client() -> dingtalkattendance_1_0Client:
        """
        Token を使用してアカウント Client を初期化します
        @return: Client
        @throws Exception
        """
        config = open_api_models.Config()
        config.protocol = 'https'
        config.region_id = 'central'
        return dingtalkattendance_1_0Client(config)

    @staticmethod
    def main(
        args: List[str],
    ) -> None:
        client = Sample.create_client()
        sync_schedule_info_headers = dingtalkattendance__1__0_models.SyncScheduleInfoHeaders()
        sync_schedule_info_headers.x_acs_dingtalk_access_token = '<your access token>'
        schedule_infos_0 = dingtalkattendance__1__0_models.SyncScheduleInfoRequestScheduleInfos(
            plan_id=12345,
            wifi_keys=[
                'CA9B334xxx'
            ],
            position_keys=[
                'CA9B334xxx'
            ],
            retain_attendance_check=False
        )
        sync_schedule_info_request = dingtalkattendance__1__0_models.SyncScheduleInfoRequest(
            schedule_infos=[
                schedule_infos_0
            ],
            op_user_id='userid123'
        )
        try:
            client.sync_schedule_info_with_options(sync_schedule_info_request, sync_schedule_info_headers, util_models.RuntimeOptions())
        except Exception as err:
            if not UtilClient.empty(err.code) and not UtilClient.empty(err.message):
                # err には code 属性と message 属性が含まれており、問題のトラブルシューティングに役立ちます
                pass

    @staticmethod
    async def main_async(
        args: List[str],
    ) -> None:
        client = Sample.create_client()
        sync_schedule_info_headers = dingtalkattendance__1__0_models.SyncScheduleInfoHeaders()
        sync_schedule_info_headers.x_acs_dingtalk_access_token = '<your access token>'
        schedule_infos_0 = dingtalkattendance__1__0_models.SyncScheduleInfoRequestScheduleInfos(
            plan_id=12345,
            wifi_keys=[
                'CA9B334xxx'
            ],
            position_keys=[
                'CA9B334xxx'
            ],
            retain_attendance_check=False
        )
        sync_schedule_info_request = dingtalkattendance__1__0_models.SyncScheduleInfoRequest(
            schedule_infos=[
                schedule_infos_0
            ],
            op_user_id='userid123'
        )
        try:
            await client.sync_schedule_info_with_options_async(sync_schedule_info_request, sync_schedule_info_headers, util_models.RuntimeOptions())
        except Exception as err:
            if not UtilClient.empty(err.code) and not UtilClient.empty(err.message):
                # err には code 属性と message 属性が含まれており、問題のトラブルシューティングに役立ちます
                pass

if __name__ == '__main__':
    Sample.main(sys.argv[1:])
```

PHP

```php theme={"theme":{"light":"github-light","dark":"github-dark"}}
<?php

// このファイルは自動生成されています。編集しないでください。
namespace AlibabaCloud\SDK\Sample;

use AlibabaCloud\SDK\Dingtalk\Vattendance_1_0\Dingtalk;
use \Exception;
use AlibabaCloud\Tea\Exception\TeaError;
use AlibabaCloud\Tea\Utils\Utils;

use Darabonba\OpenApi\Models\Config;
use AlibabaCloud\SDK\Dingtalk\Vattendance_1_0\Models\SyncScheduleInfoHeaders;
use AlibabaCloud\SDK\Dingtalk\Vattendance_1_0\Models\SyncScheduleInfoRequest\scheduleInfos;
use AlibabaCloud\SDK\Dingtalk\Vattendance_1_0\Models\SyncScheduleInfoRequest;
use AlibabaCloud\Tea\Utils\Utils\RuntimeOptions;

class Sample {

    /**
     * Token を使用してアカウント Client を初期化します
     * @return Dingtalk Client
     */
    public static function createClient(){
        $config = new Config([]);
        $config->protocol = "https";
        $config->regionId = "central";
        return new Dingtalk($config);
    }

    /**
     * @param string[] $args
     * @return void
     */
    public static function main($args){
        $client = self::createClient();
        $syncScheduleInfoHeaders = new SyncScheduleInfoHeaders([]);
        $syncScheduleInfoHeaders->xAcsDingtalkAccessToken = "<your access token>";
        $scheduleInfos0 = new scheduleInfos([
            "planId" => 12345,
            "wifiKeys" => [
                "CA9B334xxx"
            ],
            "positionKeys" => [
                "CA9B334xxx"
            ],
            "retainAttendanceCheck" => false
        ]);
        $syncScheduleInfoRequest = new SyncScheduleInfoRequest([
            "scheduleInfos" => [
                $scheduleInfos0
            ],
            "opUserId" => "userid123"
        ]);
        try {
            $client->syncScheduleInfoWithOptions($syncScheduleInfoRequest, $syncScheduleInfoHeaders, new RuntimeOptions([]));
        }
        catch (Exception $err) {
            if (!($err instanceof TeaError)) {
                $err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
            }
            if (!Utils::empty_($err->code) && !Utils::empty_($err->message)) {
                // err には code 属性と message 属性が含まれており、問題のトラブルシューティングに役立ちます
            }
        }
    }
}
$path = __DIR__ . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php';
if (file_exists($path)) {
    require_once $path;
}
Sample::main(array_slice($argv, 1));
```

Go

```go theme={"theme":{"light":"github-light","dark":"github-dark"}}
// このファイルは自動生成されています。編集しないでください。
package main

import (
  "os"
  util  "github.com/alibabacloud-go/tea-utils/v2/service"
  dingtalkattendance_1_0  "github.com/alibabacloud-go/dingtalk/attendance_1_0"
  openapi  "github.com/alibabacloud-go/darabonba-openapi/v2/client"
  "github.com/alibabacloud-go/tea/tea"
)

/**
 * Token を使用してアカウント Client を初期化します
 * @return Client
 * @throws Exception
 */
func CreateClient () (_result *dingtalkattendance_1_0.Client, _err error) {
  config := &openapi.Config{}
  config.Protocol = tea.String("https")
  config.RegionId = tea.String("central")
  _result = &dingtalkattendance_1_0.Client{}
  _result, _err = dingtalkattendance_1_0.NewClient(config)
  return _result, _err
}

func _main (args []*string) (_err error) {
  client, _err := CreateClient()
  if _err != nil {
    return _err
  }

  syncScheduleInfoHeaders := &dingtalkattendance_1_0.SyncScheduleInfoHeaders{}
  syncScheduleInfoHeaders.XAcsDingtalkAccessToken = tea.String("<your access token>")
  scheduleInfos0 := &dingtalkattendance_1_0.SyncScheduleInfoRequestScheduleInfos{
    PlanId: tea.Int64(12345),
    WifiKeys: []*string{tea.String("CA9B334xxx")},
    PositionKeys: []*string{tea.String("CA9B334xxx")},
    RetainAttendanceCheck: tea.Bool(false),
  }
  syncScheduleInfoRequest := &dingtalkattendance_1_0.SyncScheduleInfoRequest{
    ScheduleInfos: []*dingtalkattendance_1_0.SyncScheduleInfoRequestScheduleInfos{scheduleInfos0},
    OpUserId: tea.String("userid123"),
  }
  tryErr := func()(_e error) {
    defer func() {
      if r := tea.Recover(recover()); r != nil {
        _e = r
      }
    }()
    _, _err = client.SyncScheduleInfoWithOptions(syncScheduleInfoRequest, syncScheduleInfoHeaders, &util.RuntimeOptions{})
    if _err != nil {
      return _err
    }

    return nil
  }()

  if tryErr != nil {
    var err = &tea.SDKError{}
    if _t, ok := tryErr.(*tea.SDKError); ok {
      err = _t
    } else {
      err.Message = tea.String(tryErr.Error())
    }
    if !tea.BoolValue(util.Empty(err.Code)) && !tea.BoolValue(util.Empty(err.Message)) {
      // err には code 属性と message 属性が含まれており、問題のトラブルシューティングに役立ちます
    }

  }
  return _err
}

func main() {
  err := _main(tea.StringSlice(os.Args[1:]))
  if err != nil {
    panic(err)
  }
}
```

Node.js

```typescript theme={"theme":{"light":"github-light","dark":"github-dark"}}
// このファイルは自動生成されています。編集しないでください。
import Util, * as $Util from '@alicloud/tea-util';
import dingtalkattendance_1_0, * as $dingtalkattendance_1_0 from '@alicloud/dingtalk/attendance_1_0';
import OpenApi, * as $OpenApi from '@alicloud/openapi-client';
import * as $tea from '@alicloud/tea-typescript';

export default class Client {

  /**
   * Token を使用してアカウント Client を初期化します
   * @return Client
   * @throws Exception
   */
  static createClient(): dingtalkattendance_1_0 {
    let config = new $OpenApi.Config({ });
    config.protocol = "https";
    config.regionId = "central";
    return new dingtalkattendance_1_0(config);
  }

  static async main(args: string[]): Promise<void> {
    let client = Client.createClient();
    let syncScheduleInfoHeaders = new $dingtalkattendance_1_0.SyncScheduleInfoHeaders({ });
    syncScheduleInfoHeaders.xAcsDingtalkAccessToken = "<your access token>";
    let scheduleInfos0 = new $dingtalkattendance_1_0.SyncScheduleInfoRequestScheduleInfos({
      planId: 12345,
      wifiKeys: [
        "CA9B334xxx"
      ],
      positionKeys: [
        "CA9B334xxx"
      ],
      retainAttendanceCheck: false,
    });
    let syncScheduleInfoRequest = new $dingtalkattendance_1_0.SyncScheduleInfoRequest({
      scheduleInfos: [
        scheduleInfos0
      ],
      opUserId: "userid123",
    });
    try {
      await client.syncScheduleInfoWithOptions(syncScheduleInfoRequest, syncScheduleInfoHeaders, new $Util.RuntimeOptions({ }));
    } catch (err) {
      if (!Util.empty(err.code) && !Util.empty(err.message)) {
        // err には code 属性と message 属性が含まれており、問題のトラブルシューティングに役立ちます
      }

    }    
  }

}

Client.main(process.argv.slice(2));
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
// このファイルは自動生成されています。編集しないでください。

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;

using Tea;
using Tea.Utils;

namespace AlibabaCloud.SDK.Sample
{
    public class Sample 
    {

        /**
         * Token を使用してアカウント Client を初期化します
         * @return Client
         * @throws Exception
         */
        public static AlibabaCloud.SDK.Dingtalkattendance_1_0.Client CreateClient()
        {
            AlibabaCloud.OpenApiClient.Models.Config config = new AlibabaCloud.OpenApiClient.Models.Config();
            config.Protocol = "https";
            config.RegionId = "central";
            return new AlibabaCloud.SDK.Dingtalkattendance_1_0.Client(config);
        }

        public static void Main(string[] args)
        {
            AlibabaCloud.SDK.Dingtalkattendance_1_0.Client client = CreateClient();
            AlibabaCloud.SDK.Dingtalkattendance_1_0.Models.SyncScheduleInfoHeaders syncScheduleInfoHeaders = new AlibabaCloud.SDK.Dingtalkattendance_1_0.Models.SyncScheduleInfoHeaders();
            syncScheduleInfoHeaders.XAcsDingtalkAccessToken = "<your access token>";
            AlibabaCloud.SDK.Dingtalkattendance_1_0.Models.SyncScheduleInfoRequest.SyncScheduleInfoRequestScheduleInfos scheduleInfos0 = new AlibabaCloud.SDK.Dingtalkattendance_1_0.Models.SyncScheduleInfoRequest.SyncScheduleInfoRequestScheduleInfos
            {
                PlanId = 12345,
                WifiKeys = new List<string>
                {
                    "CA9B334xxx"
                },
                PositionKeys = new List<string>
                {
                    "CA9B334xxx"
                },
                RetainAttendanceCheck = false,
            };
            AlibabaCloud.SDK.Dingtalkattendance_1_0.Models.SyncScheduleInfoRequest syncScheduleInfoRequest = new AlibabaCloud.SDK.Dingtalkattendance_1_0.Models.SyncScheduleInfoRequest
            {
                ScheduleInfos = new List<AlibabaCloud.SDK.Dingtalkattendance_1_0.Models.SyncScheduleInfoRequest.SyncScheduleInfoRequestScheduleInfos>
                {
                    scheduleInfos0
                },
                OpUserId = "userid123",
            };
            try
            {
                client.SyncScheduleInfoWithOptions(syncScheduleInfoRequest, syncScheduleInfoHeaders, new AlibabaCloud.TeaUtil.Models.RuntimeOptions());
            }
            catch (TeaException err)
            {
                if (!AlibabaCloud.TeaUtil.Common.Empty(err.Code) && !AlibabaCloud.TeaUtil.Common.Empty(err.Message))
                {
                    // err には code 属性と message 属性が含まれており、問題のトラブルシューティングに役立ちます
                }
            }
            catch (Exception _err)
            {
                TeaException err = new TeaException(new Dictionary<string, object>
                {
                    { "message", _err.Message }
                });
                if (!AlibabaCloud.TeaUtil.Common.Empty(err.Code) && !AlibabaCloud.TeaUtil.Common.Empty(err.Message))
                {
                    // err には code 属性と message 属性が含まれており、問題のトラブルシューティングに役立ちます
                }
            }
        }

    }
}
```

## レスポンス

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

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
HTTP/1.1 200 OK
```

### エラーコード

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

| HttpCode | エラーコード | エラーメッセージ | 説明 |
| - | - | - | - |
| 400 | service.error | サービスエラーです | サービスエラーです |
| 400 | service.invalidParam | 入力パラメーターが無効です | 入力パラメーターが無効です |
| 500 | system.error | システムがビジー状態です | システムがビジー状態です |


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