POST https://graph.microsoft.com/v1.0/deviceAppManagement/managedEBooks
Content-type: application/json
Content-length: 792
{
"@odata.type": "#microsoft.graph.iosVppEBook",
"displayName": "Display Name value",
"description": "Description value",
"publisher": "Publisher value",
"publishedDateTime": "2016-12-31T23:58:16.1180489-08:00",
"largeCover": {
"@odata.type": "microsoft.graph.mimeContent",
"type": "Type value",
"value": "dmFsdWU="
},
"informationUrl": "https://example.com/informationUrl/",
"privacyInformationUrl": "https://example.com/privacyInformationUrl/",
"vppTokenId": "9148ac60-ac60-9148-60ac-489160ac4891",
"appleId": "Apple Id value",
"vppOrganizationName": "Vpp Organization Name value",
"genres": [
"Genres value"
],
"language": "Language value",
"seller": "Seller value",
"totalLicenseCount": 1,
"usedLicenseCount": 0
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new IosVppEBook
{
OdataType = "#microsoft.graph.iosVppEBook",
DisplayName = "Display Name value",
Description = "Description value",
Publisher = "Publisher value",
PublishedDateTime = DateTimeOffset.Parse("2016-12-31T23:58:16.1180489-08:00"),
LargeCover = new MimeContent
{
OdataType = "microsoft.graph.mimeContent",
Type = "Type value",
Value = Convert.FromBase64String("dmFsdWU="),
},
InformationUrl = "https://example.com/informationUrl/",
PrivacyInformationUrl = "https://example.com/privacyInformationUrl/",
VppTokenId = Guid.Parse("9148ac60-ac60-9148-60ac-489160ac4891"),
AppleId = "Apple Id value",
VppOrganizationName = "Vpp Organization Name value",
Genres = new List<string>
{
"Genres value",
},
Language = "Language value",
Seller = "Seller value",
TotalLicenseCount = 1,
UsedLicenseCount = 0,
};
// 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.PostAsync(requestBody);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
mgc device-app-management managed-ebooks create --body '{\
"@odata.type": "#microsoft.graph.iosVppEBook",\
"displayName": "Display Name value",\
"description": "Description value",\
"publisher": "Publisher value",\
"publishedDateTime": "2016-12-31T23:58:16.1180489-08:00",\
"largeCover": {\
"@odata.type": "microsoft.graph.mimeContent",\
"type": "Type value",\
"value": "dmFsdWU="\
},\
"informationUrl": "https://example.com/informationUrl/",\
"privacyInformationUrl": "https://example.com/privacyInformationUrl/",\
"vppTokenId": "9148ac60-ac60-9148-60ac-489160ac4891",\
"appleId": "Apple Id value",\
"vppOrganizationName": "Vpp Organization Name value",\
"genres": [\
"Genres value"\
],\
"language": "Language value",\
"seller": "Seller value",\
"totalLicenseCount": 1,\
"usedLicenseCount": 0\
}\
'
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
"time"
"github.com/google/uuid"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewManagedEBook()
displayName := "Display Name value"
requestBody.SetDisplayName(&displayName)
description := "Description value"
requestBody.SetDescription(&description)
publisher := "Publisher value"
requestBody.SetPublisher(&publisher)
publishedDateTime , err := time.Parse(time.RFC3339, "2016-12-31T23:58:16.1180489-08:00")
requestBody.SetPublishedDateTime(&publishedDateTime)
largeCover := graphmodels.NewMimeContent()
type := "Type value"
largeCover.SetType(&type)
value := []byte("dmFsdWU=")
largeCover.SetValue(&value)
requestBody.SetLargeCover(largeCover)
informationUrl := "https://example.com/informationUrl/"
requestBody.SetInformationUrl(&informationUrl)
privacyInformationUrl := "https://example.com/privacyInformationUrl/"
requestBody.SetPrivacyInformationUrl(&privacyInformationUrl)
vppTokenId := uuid.MustParse("9148ac60-ac60-9148-60ac-489160ac4891")
requestBody.SetVppTokenId(&vppTokenId)
appleId := "Apple Id value"
requestBody.SetAppleId(&appleId)
vppOrganizationName := "Vpp Organization Name value"
requestBody.SetVppOrganizationName(&vppOrganizationName)
genres := []string {
"Genres value",
}
requestBody.SetGenres(genres)
language := "Language value"
requestBody.SetLanguage(&language)
seller := "Seller value"
requestBody.SetSeller(&seller)
totalLicenseCount := int32(1)
requestBody.SetTotalLicenseCount(&totalLicenseCount)
usedLicenseCount := int32(0)
requestBody.SetUsedLicenseCount(&usedLicenseCount)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
managedEBooks, err := graphClient.DeviceAppManagement().ManagedEBooks().Post(context.Background(), requestBody, nil)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
IosVppEBook managedEBook = new IosVppEBook();
managedEBook.setOdataType("#microsoft.graph.iosVppEBook");
managedEBook.setDisplayName("Display Name value");
managedEBook.setDescription("Description value");
managedEBook.setPublisher("Publisher value");
OffsetDateTime publishedDateTime = OffsetDateTime.parse("2016-12-31T23:58:16.1180489-08:00");
managedEBook.setPublishedDateTime(publishedDateTime);
MimeContent largeCover = new MimeContent();
largeCover.setOdataType("microsoft.graph.mimeContent");
largeCover.setType("Type value");
byte[] value = Base64.getDecoder().decode("dmFsdWU=");
largeCover.setValue(value);
managedEBook.setLargeCover(largeCover);
managedEBook.setInformationUrl("https://example.com/informationUrl/");
managedEBook.setPrivacyInformationUrl("https://example.com/privacyInformationUrl/");
managedEBook.setVppTokenId(UUID.fromString("9148ac60-ac60-9148-60ac-489160ac4891"));
managedEBook.setAppleId("Apple Id value");
managedEBook.setVppOrganizationName("Vpp Organization Name value");
LinkedList<String> genres = new LinkedList<String>();
genres.add("Genres value");
managedEBook.setGenres(genres);
managedEBook.setLanguage("Language value");
managedEBook.setSeller("Seller value");
managedEBook.setTotalLicenseCount(1);
managedEBook.setUsedLicenseCount(0);
ManagedEBook result = graphClient.deviceAppManagement().managedEBooks().post(managedEBook);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
const managedEBook = {
'@odata.type': '#microsoft.graph.iosVppEBook',
displayName: 'Display Name value',
description: 'Description value',
publisher: 'Publisher value',
publishedDateTime: '2016-12-31T23:58:16.1180489-08:00',
largeCover: {
'@odata.type': 'microsoft.graph.mimeContent',
type: 'Type value',
value: 'dmFsdWU='
},
informationUrl: 'https://example.com/informationUrl/',
privacyInformationUrl: 'https://example.com/privacyInformationUrl/',
vppTokenId: '9148ac60-ac60-9148-60ac-489160ac4891',
appleId: 'Apple Id value',
vppOrganizationName: 'Vpp Organization Name value',
genres: [
'Genres value'
],
language: 'Language value',
seller: 'Seller value',
totalLicenseCount: 1,
usedLicenseCount: 0
};
await client.api('/deviceAppManagement/managedEBooks')
.post(managedEBook);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\IosVppEBook;
use Microsoft\Graph\Generated\Models\MimeContent;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new IosVppEBook();
$requestBody->setOdataType('#microsoft.graph.iosVppEBook');
$requestBody->setDisplayName('Display Name value');
$requestBody->setDescription('Description value');
$requestBody->setPublisher('Publisher value');
$requestBody->setPublishedDateTime(new \DateTime('2016-12-31T23:58:16.1180489-08:00'));
$largeCover = new MimeContent();
$largeCover->setOdataType('microsoft.graph.mimeContent');
$largeCover->setType('Type value');
$largeCover->setValue(\GuzzleHttp\Psr7\Utils::streamFor(base64_decode('dmFsdWU=')));
$requestBody->setLargeCover($largeCover);
$requestBody->setInformationUrl('https://example.com/informationUrl/');
$requestBody->setPrivacyInformationUrl('https://example.com/privacyInformationUrl/');
$requestBody->setVppTokenId('9148ac60-ac60-9148-60ac-489160ac4891');
$requestBody->setAppleId('Apple Id value');
$requestBody->setVppOrganizationName('Vpp Organization Name value');
$requestBody->setGenres(['Genres value', ]);
$requestBody->setLanguage('Language value');
$requestBody->setSeller('Seller value');
$requestBody->setTotalLicenseCount(1);
$requestBody->setUsedLicenseCount(0);
$result = $graphServiceClient->deviceAppManagement()->managedEBooks()->post($requestBody)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Devices.CorporateManagement
$params = @{
"@odata.type" = "#microsoft.graph.iosVppEBook"
displayName = "Display Name value"
description = "Description value"
publisher = "Publisher value"
publishedDateTime = [System.DateTime]::Parse("2016-12-31T23:58:16.1180489-08:00")
largeCover = @{
"@odata.type" = "microsoft.graph.mimeContent"
type = "Type value"
value = [System.Text.Encoding]::ASCII.GetBytes("dmFsdWU=")
}
informationUrl = "https://example.com/informationUrl/"
privacyInformationUrl = "https://example.com/privacyInformationUrl/"
vppTokenId = "9148ac60-ac60-9148-60ac-489160ac4891"
appleId = "Apple Id value"
vppOrganizationName = "Vpp Organization Name value"
genres = @(
"Genres value"
)
language = "Language value"
seller = "Seller value"
totalLicenseCount =
usedLicenseCount =
}
New-MgDeviceAppManagementManagedEBook -BodyParameter $params
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# 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 import IosVppEBook
from msgraph.generated.models.mime_content import MimeContent
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = IosVppEBook(
odata_type = "#microsoft.graph.iosVppEBook",
display_name = "Display Name value",
description = "Description value",
publisher = "Publisher value",
published_date_time = "2016-12-31T23:58:16.1180489-08:00",
large_cover = MimeContent(
odata_type = "microsoft.graph.mimeContent",
type = "Type value",
value = base64.urlsafe_b64decode("dmFsdWU="),
),
information_url = "https://example.com/informationUrl/",
privacy_information_url = "https://example.com/privacyInformationUrl/",
vpp_token_id = UUID("9148ac60-ac60-9148-60ac-489160ac4891"),
apple_id = "Apple Id value",
vpp_organization_name = "Vpp Organization Name value",
genres = [
"Genres value",
],
language = "Language value",
seller = "Seller value",
total_license_count = 1,
used_license_count = 0,
)
result = await graph_client.device_app_management.managed_e_books.post(request_body)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。