Criar iosVppEBook
Artigo 08/01/2024
13 colaboradores
Comentários
Neste artigo
Namespace: microsoft.graph
Observação: A API do Microsoft Graph para Intune requer uma licença ativa do Intune para o locatário.
Cria um novo objeto iosVppEBook .
Esta API está disponível nas seguintes implementações de cloud nacionais .
Serviço global
US Government L4
US Government L5 (DOD)
China operada pela 21Vianet
✅
✅
✅
✅
Permissões
Uma das seguintes permissões é necessária para chamar esta API. Para saber mais, incluindo como escolher permissões, confira Permissões .
Tipo de permissão
Permissões (da com menos para a com mais privilégios)
Delegado (conta corporativa ou de estudante)
DeviceManagementApps.ReadWrite.All
Delegado (conta pessoal da Microsoft)
Sem suporte.
Application
DeviceManagementApps.ReadWrite.All
Solicitação HTTP
POST /deviceAppManagement/managedEBooks
Cabeçalho
Valor
Autorização
{token} de portador. Obrigatório. Saiba mais sobre autenticação e autorização .
Aceitar
application/json
Corpo da solicitação
No corpo da solicitação, forneça uma representação JSON do objeto iosVppEBook.
A tabela a seguir mostra as propriedades obrigatórias ao criar iosVppEBook.
Propriedade
Tipo
Descrição
id
String
Chave da entidade. Herdada de managedEBook
displayName
Cadeia de caracteres
Nome do livro eletrônico. Herdada de managedEBook
description
Cadeia de caracteres
Descrição. Herdada de managedEBook
publisher
Cadeia de caracteres
Publicador. Herdada de managedEBook
publishedDateTime
DateTimeOffset
A data e hora em que o livro eletrônico foi publicado. Herdada de managedEBook
largeCover
mimeContent
Capa do livro. Herdada de managedEBook
createdDateTime
DateTimeOffset
A data e hora em que o livro eletrônico foi modificado pela última vez. Herdada de managedEBook
lastModifiedDateTime
DateTimeOffset
A data e hora da última modificação do livro eletrônico. Herdada de managedEBook
informationUrl
String
A URL de informações adicionais. Herdada de managedEBook
privacyInformationUrl
String
A URL da declaração de privacidade. Herdada de managedEBook
vppTokenId
Guid
A ID de token Vpp.
appleId
Cadeia de caracteres
O Apple ID associado ao token Vpp.
vppOrganizationName
Cadeia de caracteres
O nome da organização do token Vpp.
genres
Coleção de cadeia de caracteres
Gêneros.
idioma
Cadeia de caracteres
Idioma.
seller
Cadeia de caracteres
Vendedor.
totalLicenseCount
Int32
Contagem total de licenças.
usedLicenseCount
Int32
Contagem de licenças usadas.
Resposta
Se tiver êxito, este método retornará o código de resposta 201 Created
e um objeto iosVppEBook no corpo da resposta.
Exemplo
Solicitação
Este é um exemplo da solicitação.
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);
Para obter detalhes sobre como adicionar o SDK ao seu projeto e criar uma instância authProvider , consulte a documentação do 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\
}\
'
Para obter detalhes sobre como adicionar o SDK ao seu projeto e criar uma instância authProvider , consulte a documentação do 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)
Para obter detalhes sobre como adicionar o SDK ao seu projeto e criar uma instância authProvider , consulte a documentação do 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);
Para obter detalhes sobre como adicionar o SDK ao seu projeto e criar uma instância authProvider , consulte a documentação do 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);
Para obter detalhes sobre como adicionar o SDK ao seu projeto e criar uma instância authProvider , consulte a documentação do 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();
Para obter detalhes sobre como adicionar o SDK ao seu projeto e criar uma instância authProvider , consulte a documentação do 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
Para obter detalhes sobre como adicionar o SDK ao seu projeto e criar uma instância authProvider , consulte a documentação do 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)
Para obter detalhes sobre como adicionar o SDK ao seu projeto e criar uma instância authProvider , consulte a documentação do SDK .
Resposta
Veja a seguir um exemplo da resposta. Observação: o objeto response mostrado aqui pode estar truncado por motivos de concisão. Todas as propriedades serão retornadas de uma chamada real.
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 964
{
"@odata.type": "#microsoft.graph.iosVppEBook",
"id": "3b9f627e-627e-3b9f-7e62-9f3b7e629f3b",
"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="
},
"createdDateTime": "2017-01-01T00:02:43.5775965-08:00",
"lastModifiedDateTime": "2017-01-01T00:00:35.1329464-08:00",
"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
}