Elija el permiso o los permisos marcados como con privilegios mínimos para esta API. Use un permiso o permisos con privilegios superiores solo si la aplicación lo requiere. Para obtener más información sobre los permisos delegados y de aplicación, consulte Tipos de permisos. Para obtener más información sobre estos permisos, consulte la referencia de permisos.
Tipo de permiso
Permisos con privilegios mínimos
Permisos con privilegios más altos
Delegado (cuenta profesional o educativa)
FileStorageContainer.Selected
No disponible.
Delegado (cuenta personal de Microsoft)
No admitida.
No admitida.
Aplicación
FileStorageContainer.Selected
No disponible.
Además de los permisos de Microsoft Graph, la aplicación también debe tener los permisos o permisos de nivel de tipo de contenedor necesarios para llamar a esta API. Para obtener más información sobre los tipos de contenedor, consulte Tipos de contenedor. Para obtener más información sobre los permisos de nivel de tipo contenedor, vea Autorización de SharePoint Embedded.
POST https://graph.microsoft.com/v1.0/storage/fileStorage/containers
Content-Type: application/json
{
"displayName": "My Application Storage Container",
"description": "Description of My Application Storage Container",
"containerTypeId": "91710488-5756-407f-9046-fbe5f0b4de73",
"settings": {
"isOcrEnabled": true
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
using Microsoft.Kiota.Abstractions.Serialization;
var requestBody = new FileStorageContainer
{
DisplayName = "My Application Storage Container",
Description = "Description of My Application Storage Container",
ContainerTypeId = Guid.Parse("91710488-5756-407f-9046-fbe5f0b4de73"),
AdditionalData = new Dictionary<string, object>
{
{
"settings" , new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"isOcrEnabled", new UntypedBoolean(true)
},
})
},
},
};
// 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.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
"github.com/google/uuid"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewFileStorageContainer()
displayName := "My Application Storage Container"
requestBody.SetDisplayName(&displayName)
description := "Description of My Application Storage Container"
requestBody.SetDescription(&description)
containerTypeId := uuid.MustParse("91710488-5756-407f-9046-fbe5f0b4de73")
requestBody.SetContainerTypeId(&containerTypeId)
additionalData := map[string]interface{}{
settings := graph.New()
isOcrEnabled := true
settings.SetIsOcrEnabled(&isOcrEnabled)
requestBody.SetSettings(settings)
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
containers, err := graphClient.Storage().FileStorage().Containers().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
FileStorageContainer fileStorageContainer = new FileStorageContainer();
fileStorageContainer.setDisplayName("My Application Storage Container");
fileStorageContainer.setDescription("Description of My Application Storage Container");
fileStorageContainer.setContainerTypeId(UUID.fromString("91710488-5756-407f-9046-fbe5f0b4de73"));
HashMap<String, Object> additionalData = new HashMap<String, Object>();
settings = new ();
settings.setIsOcrEnabled(true);
additionalData.put("settings", settings);
fileStorageContainer.setAdditionalData(additionalData);
FileStorageContainer result = graphClient.storage().fileStorage().containers().post(fileStorageContainer);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.file_storage_container import FileStorageContainer
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = FileStorageContainer(
display_name = "My Application Storage Container",
description = "Description of My Application Storage Container",
container_type_id = UUID("91710488-5756-407f-9046-fbe5f0b4de73"),
additional_data = {
"settings" : {
"is_ocr_enabled" : True,
},
}
)
result = await graph_client.storage.file_storage.containers.post(request_body)