Acl: insert
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
アクセス制御ルールを作成します。実習をご覧ください。
リクエスト
HTTP リクエスト
POST https://www.googleapis.com/calendar/v3/calendars/calendarId/acl
パラメータ
パラメータ名 |
値 |
説明 |
パスパラメータ |
calendarId |
string |
カレンダー ID。カレンダー ID を取得するには、calendarList.list メソッドを呼び出します。現在ログインしているユーザーのメイン カレンダーにアクセスするには、「primary 」キーワードを使用します。
|
省略可能なクエリ パラメータ |
sendNotifications |
boolean |
カレンダーの共有の変更に関する通知を送信するかどうか。省略可。デフォルトは True です。 |
承認
このリクエストは、少なくとも次のうち 1 つのスコープによる承認が必要です。
範囲 |
https://www.googleapis.com/auth/calendar |
https://www.googleapis.com/auth/calendar.acls |
詳しくは、認証と認可のページをご覧ください。
リクエストの本文
リクエストの本文には、以下のプロパティを使用して Acl リソースを指定します。
プロパティ名 |
値 |
説明 |
メモ |
必須プロパティ |
role |
string |
スコープに割り当てられたロール。指定できる値は次のとおりです。 - 「
none 」- アクセス権を付与しません。 - 「
freeBusyReader 」- 空き時間情報への読み取りアクセス権を付与します。 - 「
reader 」 - カレンダーへの読み取りアクセス権を付与します。限定公開のイベントは、閲覧者権限を持つユーザーには表示されますが、イベントの詳細は非表示になります。 - 「
writer 」- カレンダーに対する読み取り / 書き込みアクセス権を付与します。限定公開の予定は、作成者権限を持つユーザーに表示され、イベントの詳細も表示されます。カレンダーの ACL に対する読み取りアクセス権を付与します。 - 「
owner 」 - カレンダーのオーナー権限を付与します。このロールには、書き込みロールのすべての権限に加えて、ACL を操作する権限があります。 |
書き込み可能
|
scope |
object |
この ACL ルールによってカレンダーへのアクセスが許可される範囲。 |
|
scope.type |
string |
スコープのタイプ。指定できる値は次のとおりです。 - 「
default 」- 公開スコープ。これがデフォルト値です。 - 「
user 」- スコープを 1 人のユーザーに制限します。 - 「
group 」 - スコープをグループに制限します。 - 「
domain 」 - スコープをドメインに制限します。 注: 「default 」スコープ(公開スコープ)に付与された権限は、認証されているかどうかにかかわらず、すべてのユーザーに適用されます。 |
|
省略可能なプロパティ |
scope.value |
string |
スコープの種類に応じて、ユーザーまたはグループのメールアドレス、またはドメイン名。タイプ「default 」の場合は省略されます。 |
書き込み可能
|
レスポンス
成功すると、このメソッドはレスポンスの本文で Acl リソースを返します。
試してみよう:
以下の API Explorer を使用して、ライブデータに対してこのメソッドを呼び出し、レスポンスを確認します。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[],[],null,["# Acl: insert\n\n| **Note:** Requires [authorization](#auth).\n\nCreates an access control rule.\n[Try it now](#try-it).\n\nRequest\n-------\n\n### HTTP request\n\n```\nPOST https://www.googleapis.com/calendar/v3/calendars/calendarId/acl\n```\n\n### Parameters\n\n| Parameter name | Value | Description |\n|---------------------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Path parameters** |||\n| `calendarId` | `string` | Calendar identifier. To retrieve calendar IDs call the [calendarList.list](/workspace/calendar/api/v3/reference/calendarList/list) method. If you want to access the primary calendar of the currently logged in user, use the \"`primary`\" keyword. |\n| **Optional query parameters** |||\n| `sendNotifications` | `boolean` | Whether to send notifications about the calendar sharing change. Optional. The default is True. |\n\n### Authorization\n\nThis request requires authorization with at least one of the following scopes:\n\n| Scope |\n|-------------------------------------------------|\n| `https://www.googleapis.com/auth/calendar` |\n| `https://www.googleapis.com/auth/calendar.acls` |\n\nFor more information, see the [authentication and authorization](/workspace/guides/configure-oauth-consent) page.\n\n### Request body\n\nIn the request body, supply an [Acl resource](/workspace/calendar/api/v3/reference/acl#resource) with the following properties:\n\n| Property name | Value | Description | Notes |\n|---------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|\n| **Required Properties** ||||\n| `role` | `string` | The role assigned to the scope. Possible values are: - \"`none`\" - Provides no access. - \"`freeBusyReader`\" - Provides read access to free/busy information. - \"`reader`\" - Provides read access to the calendar. Private events will appear to users with reader access, but event details will be hidden. - \"`writer`\" - Provides read and write access to the calendar. Private events will appear to users with writer access, and event details will be visible. Provides read access to the calendar's ACLs. - \"`owner`\" - Provides ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to manipulate ACLs. | writable |\n| `scope` | `object` | The extent to which [calendar access](https://developers.google.com/workspace/calendar/concepts/sharing#sharing_calendars) is granted by this ACL rule. | |\n| scope.`type` | `string` | The type of the scope. Possible values are: - \"`default`\" - The public scope. This is the default value. - \"`user`\" - Limits the scope to a single user. - \"`group`\" - Limits the scope to a group. - \"`domain`\" - Limits the scope to a domain. Note: The permissions granted to the \"`default`\", or public, scope apply to any user, authenticated or not. | |\n| **Optional Properties** ||||\n| scope.`value` | `string` | The email address of a user or group, or the name of a domain, depending on the scope type. Omitted for type \"`default`\". | writable |\n\nResponse\n--------\n\nIf successful, this method returns an [Acl resource](/workspace/calendar/api/v3/reference/acl#resource) in the response body.\n\nTry it!\n-------\n\n\nUse the APIs Explorer below to call this method on live data and see the response."]]