L’une des autorisations suivantes est nécessaire pour appeler cette API. Pour plus d’informations, notamment sur la façon de choisir les autorisations, voir Autorisations.
Type d’autorisation
Autorisations (de celle qui offre le plus de privilèges à celle qui en offre le moins)
Déléguée (compte professionnel ou scolaire)
DeviceManagementApps.ReadWrite.All
Déléguée (compte Microsoft personnel)
Non prise en charge.
Application
DeviceManagementApps.ReadWrite.All
Requête HTTP
POST /deviceAppManagement/managedEBooks/{managedEBookId}/assignments
Objectif d’installation pour le livre électronique. Hérité de managedEBookAssignment. Les valeurs possibles sont les suivantes : available, required, uninstall, availableWithoutEnrollment.
Réponse
Si elle réussit, cette méthode renvoie un code de réponse 201 Created et un objet iosVppEBookAssignment dans le corps de la réponse.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new IosVppEBookAssignment
{
OdataType = "#microsoft.graph.iosVppEBookAssignment",
Target = new DeviceAndAppManagementAssignmentTarget
{
OdataType = "microsoft.graph.deviceAndAppManagementAssignmentTarget",
},
InstallIntent = InstallIntent.Required,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceAppManagement.ManagedEBooks["{managedEBook-id}"].Assignments.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewManagedEBookAssignment()
target := graphmodels.NewDeviceAndAppManagementAssignmentTarget()
requestBody.SetTarget(target)
installIntent := graphmodels.REQUIRED_INSTALLINTENT
requestBody.SetInstallIntent(&installIntent)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
assignments, err := graphClient.DeviceAppManagement().ManagedEBooks().ByManagedEBookId("managedEBook-id").Assignments().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
IosVppEBookAssignment managedEBookAssignment = new IosVppEBookAssignment();
managedEBookAssignment.setOdataType("#microsoft.graph.iosVppEBookAssignment");
DeviceAndAppManagementAssignmentTarget target = new DeviceAndAppManagementAssignmentTarget();
target.setOdataType("microsoft.graph.deviceAndAppManagementAssignmentTarget");
managedEBookAssignment.setTarget(target);
managedEBookAssignment.setInstallIntent(InstallIntent.Required);
ManagedEBookAssignment result = graphClient.deviceAppManagement().managedEBooks().byManagedEBookId("{managedEBook-id}").assignments().post(managedEBookAssignment);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\IosVppEBookAssignment;
use Microsoft\Graph\Generated\Models\DeviceAndAppManagementAssignmentTarget;
use Microsoft\Graph\Generated\Models\InstallIntent;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new IosVppEBookAssignment();
$requestBody->setOdataType('#microsoft.graph.iosVppEBookAssignment');
$target = new DeviceAndAppManagementAssignmentTarget();
$target->setOdataType('microsoft.graph.deviceAndAppManagementAssignmentTarget');
$requestBody->setTarget($target);
$requestBody->setInstallIntent(new InstallIntent('required'));
$result = $graphServiceClient->deviceAppManagement()->managedEBooks()->byManagedEBookId('managedEBook-id')->assignments()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.ios_vpp_e_book_assignment import IosVppEBookAssignment
from msgraph.generated.models.device_and_app_management_assignment_target import DeviceAndAppManagementAssignmentTarget
from msgraph.generated.models.install_intent import InstallIntent
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = IosVppEBookAssignment(
odata_type = "#microsoft.graph.iosVppEBookAssignment",
target = DeviceAndAppManagementAssignmentTarget(
odata_type = "microsoft.graph.deviceAndAppManagementAssignmentTarget",
),
install_intent = InstallIntent.Required,
)
result = await graph_client.device_app_management.managed_e_books.by_managed_e_book_id('managedEBook-id').assignments.post(request_body)
Voici un exemple de réponse. Remarque : l’objet de réponse illustré ici peut être tronqué à des fins de concision. Toutes les propriétés sont renvoyées à partir d’un appel réel.