名前空間: microsoft.graph
重要
Microsoft Graph の /beta バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。
新しい sharePointGroup オブジェクトを作成します。
sharePointGroup は、作成された fileStorageContainer のスコープ内にのみ存在します。
driveItem オブジェクトに sharePointGroup のアクセス許可を追加するには、driveItem API の作成アクセス許可を使用する必要があります。
fileStorageContainer ごとに最大 10,000 個の sharePointGroup オブジェクトを作成できます。 サービスの制限の詳細については、「 SharePoint オンライン制限」を参照してください。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
✅ |
✅ |
✅ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
サポートされていません。 |
サポートされていません。 |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
FileStorageContainer.Selected |
注意事項なし。 |
注:
Microsoft Graph のアクセス許可に加えて、この API を呼び出すアプリケーションには、対応するコンテナーのコンテナーの種類に対する AddPermissions コンテナーの種類レベルのアクセス許可が少なくとも必要です。 詳細については、「 コンテナーの種類」を参照してください。 コンテナーの種類レベルのアクセス許可の詳細については、「 SharePoint Embedded 承認」を参照してください。
HTTP 要求
POST /storage/fileStorage/containers/{fileStorageContainerId}/sharePointGroups
| 名前 |
説明 |
| Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
| Content-Type |
application/json. 必須です。 |
要求本文
要求本文で、 sharePointGroup オブジェクトの JSON 表現を指定します。
sharePointGroup を作成するときに、次のプロパティを指定できます。
| プロパティ |
型 |
説明 |
| description |
String |
sharePointGroup のユーザーが表示する説明。 説明は 512 文字を超えることはできません。 省略可能。 |
| title |
String |
sharePointGroup のタイトル。 タイトルは 255 文字を超えることはできません。 必須です。 |
応答
成功した場合、このメソッドは応答コード 201 Created と応答本文に sharePointGroup オブジェクトを返します。
例
要求
次の例は、fileStoragContainer に対してローカルな新しい sharePointGroup を作成する要求を示しています。
sharePointGroup のタイトルと説明が要求本文に表示されます。
POST https://graph.microsoft.com/beta/storage/fileStorage/containers/b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z/sharePointGroups
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.sharePointGroup",
"title": "Sample Group",
"description": "This is a sample description"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new SharePointGroup
{
OdataType = "#microsoft.graph.sharePointGroup",
Title = "Sample Group",
Description = "This is a sample description",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Storage.FileStorage.Containers["{fileStorageContainer-id}"].SharePointGroups.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewSharePointGroup()
title := "Sample Group"
requestBody.SetTitle(&title)
description := "This is a sample description"
requestBody.SetDescription(&description)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
sharePointGroups, err := graphClient.Storage().FileStorage().Containers().ByFileStorageContainerId("fileStorageContainer-id").SharePointGroups().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
SharePointGroup sharePointGroup = new SharePointGroup();
sharePointGroup.setOdataType("#microsoft.graph.sharePointGroup");
sharePointGroup.setTitle("Sample Group");
sharePointGroup.setDescription("This is a sample description");
SharePointGroup result = graphClient.storage().fileStorage().containers().byFileStorageContainerId("{fileStorageContainer-id}").sharePointGroups().post(sharePointGroup);
const options = {
authProvider,
};
const client = Client.init(options);
const sharePointGroup = {
'@odata.type': '#microsoft.graph.sharePointGroup',
title: 'Sample Group',
description: 'This is a sample description'
};
await client.api('/storage/fileStorage/containers/b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z/sharePointGroups')
.version('beta')
.post(sharePointGroup);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\SharePointGroup;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new SharePointGroup();
$requestBody->setOdataType('#microsoft.graph.sharePointGroup');
$requestBody->setTitle('Sample Group');
$requestBody->setDescription('This is a sample description');
$result = $graphServiceClient->storage()->fileStorage()->containers()->byFileStorageContainerId('fileStorageContainer-id')->sharePointGroups()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.share_point_group import SharePointGroup
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = SharePointGroup(
odata_type = "#microsoft.graph.sharePointGroup",
title = "Sample Group",
description = "This is a sample description",
)
result = await graph_client.storage.file_storage.containers.by_file_storage_container_id('fileStorageContainer-id').share_point_groups.post(request_body)
応答
次の例は応答を示しています。 グループは、識別子として機能する新しく割り当てられた ID で正常に作成されます。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.sharePointGroup",
"id" : "4",
"title": "Sample Group",
"description": "This is sample description"
}