Namespace: microsoft.graph
Note: The Microsoft Graph API for Intune requires an active Intune license for the tenant.
Update the properties of a iosVppEBookAssignment object.
This API is available in the following national cloud deployments.
Global service |
US Government L4 |
US Government L5 (DOD) |
China operated by 21Vianet |
✅ |
✅ |
✅ |
✅ |
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission type |
Permissions (from least to most privileged) |
Delegated (work or school account) |
DeviceManagementApps.ReadWrite.All |
Delegated (personal Microsoft account) |
Not supported. |
Application |
DeviceManagementApps.ReadWrite.All |
HTTP Request
PATCH /deviceAppManagement/managedEBooks/{managedEBookId}/assignments/{managedEBookAssignmentId}
Request body
In the request body, supply a JSON representation for the iosVppEBookAssignment object.
The following table shows the properties that are required when you create the iosVppEBookAssignment.
Response
If successful, this method returns a 200 OK
response code and an updated iosVppEBookAssignment object in the response body.
Example
Request
Here is an example of the request.
PATCH https://graph.microsoft.com/v1.0/deviceAppManagement/managedEBooks/{managedEBookId}/assignments/{managedEBookAssignmentId}
Content-type: application/json
Content-length: 193
{
"@odata.type": "#microsoft.graph.iosVppEBookAssignment",
"target": {
"@odata.type": "microsoft.graph.deviceAndAppManagementAssignmentTarget"
},
"installIntent": "required"
}
// 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["{managedEBookAssignment-id}"].PatchAsync(requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
mgc device-app-management managed-ebooks assignments patch --managed-ebook-id {managedEBook-id} --managed-ebook-assignment-id {managedEBookAssignment-id} --body '{\
"@odata.type": "#microsoft.graph.iosVppEBookAssignment",\
"target": {\
"@odata.type": "microsoft.graph.deviceAndAppManagementAssignmentTarget"\
},\
"installIntent": "required"\
}\
'
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// 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().ByManagedEBookAssignmentId("managedEBookAssignment-id").Patch(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// 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().byManagedEBookAssignmentId("{managedEBookAssignment-id}").patch(managedEBookAssignment);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
const options = {
authProvider,
};
const client = Client.init(options);
const managedEBookAssignment = {
'@odata.type': '#microsoft.graph.iosVppEBookAssignment',
target: {
'@odata.type': 'microsoft.graph.deviceAndAppManagementAssignmentTarget'
},
installIntent: 'required'
};
await client.api('/deviceAppManagement/managedEBooks/{managedEBookId}/assignments/{managedEBookAssignmentId}')
.update(managedEBookAssignment);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
<?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()->byManagedEBookAssignmentId('managedEBookAssignment-id')->patch($requestBody)->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Import-Module Microsoft.Graph.Devices.CorporateManagement
$params = @{
"@odata.type" = "#microsoft.graph.iosVppEBookAssignment"
target = @{
"@odata.type" = "microsoft.graph.deviceAndAppManagementAssignmentTarget"
}
installIntent = "required"
}
Update-MgDeviceAppManagementManagedEBookAssignment -ManagedEBookId $managedEBookId -ManagedEBookAssignmentId $managedEBookAssignmentId -BodyParameter $params
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
# 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.by_managed_e_book_assignment_id('managedEBookAssignment-id').patch(request_body)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Response
Here is an example of the response. Note: The response object shown here may be truncated for brevity. All of the properties will be returned from an actual call.
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 242
{
"@odata.type": "#microsoft.graph.iosVppEBookAssignment",
"id": "48f05789-5789-48f0-8957-f0488957f048",
"target": {
"@odata.type": "microsoft.graph.deviceAndAppManagementAssignmentTarget"
},
"installIntent": "required"
}