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)
Indique le système d’exploitation/plateforme de l’application découverte. Certaines valeurs possibles sont Windows, iOS, macOS. La valeur par défaut est inconnue (0). Les valeurs possibles sont les suivantes : unknown, windows, windowsMobile, windowsHolographic, ios, macOS, chromeOS, androidOSP, androidDeviceAdministrator, androidWorkProfile, androidDedicatedAndFullyManaged et unknownFutureValue.
Réponse
Si elle réussit, cette méthode renvoie un code de réponse 201 Created et un objet detectedApp 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 DetectedApp
{
OdataType = "#microsoft.graph.detectedApp",
DisplayName = "Display Name value",
Version = "Version value",
SizeInByte = 10L,
DeviceCount = 11,
Publisher = "Publisher value",
Platform = DetectedAppPlatformType.Windows,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.DetectedApps.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.NewDetectedApp()
displayName := "Display Name value"
requestBody.SetDisplayName(&displayName)
version := "Version value"
requestBody.SetVersion(&version)
sizeInByte := int64(10)
requestBody.SetSizeInByte(&sizeInByte)
deviceCount := int32(11)
requestBody.SetDeviceCount(&deviceCount)
publisher := "Publisher value"
requestBody.SetPublisher(&publisher)
platform := graphmodels.WINDOWS_DETECTEDAPPPLATFORMTYPE
requestBody.SetPlatform(&platform)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
detectedApps, err := graphClient.DeviceManagement().DetectedApps().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
DetectedApp detectedApp = new DetectedApp();
detectedApp.setOdataType("#microsoft.graph.detectedApp");
detectedApp.setDisplayName("Display Name value");
detectedApp.setVersion("Version value");
detectedApp.setSizeInByte(10L);
detectedApp.setDeviceCount(11);
detectedApp.setPublisher("Publisher value");
detectedApp.setPlatform(DetectedAppPlatformType.Windows);
DetectedApp result = graphClient.deviceManagement().detectedApps().post(detectedApp);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.detected_app import DetectedApp
from msgraph.generated.models.detected_app_platform_type import DetectedAppPlatformType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = DetectedApp(
odata_type = "#microsoft.graph.detectedApp",
display_name = "Display Name value",
version = "Version value",
size_in_byte = 10,
device_count = 11,
publisher = "Publisher value",
platform = DetectedAppPlatformType.Windows,
)
result = await graph_client.device_management.detected_apps.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.