targetedManagedAppConfiguration の作成
[アーティクル]
01/31/2024
11 人の共同作成者
フィードバック
この記事の内容
名前空間: microsoft.graph
注: Intune 用 Microsoft Graph API には、テナントの有効な Intune ライセンス が必要です。
新しい targetedManagedAppConfiguration オブジェクトを作成します。
この API は、次の国内クラウド展開 で使用できます。
グローバル サービス
米国政府機関 L4
米国政府機関 L5 (DOD)
21Vianet が運営する中国
✅
✅
✅
✅
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。 アクセス許可の選択方法などの詳細については、「アクセス許可 」を参照してください。
アクセス許可の種類
アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校のアカウント)
DeviceManagementApps.ReadWrite.All
委任 (個人用 Microsoft アカウント)
サポートされていません。
アプリケーション
DeviceManagementApps.ReadWrite.All
HTTP 要求
POST /deviceAppManagement/targetedManagedAppConfigurations
ヘッダー
値
Authorization
ベアラー {token}。 必須です。 認証と承認 の詳細については、こちらをご覧ください。
承諾
application/json
要求本文
要求本文で、targetedManagedAppConfiguration オブジェクトの JSON 表記を指定します。
次の表に、targetedManagedAppConfiguration の作成時に必要なプロパティを示します。
応答
成功した場合、このメソッドは 201 Created
応答コードと、応答本文で targetedManagedAppConfiguration オブジェクトを返します。
例
要求
以下は、要求の例です。
POST https://graph.microsoft.com/v1.0/deviceAppManagement/targetedManagedAppConfigurations
Content-type: application/json
Content-length: 388
{
"@odata.type": "#microsoft.graph.targetedManagedAppConfiguration",
"displayName": "Display Name value",
"description": "Description value",
"version": "Version value",
"customSettings": [
{
"@odata.type": "microsoft.graph.keyValuePair",
"name": "Name value",
"value": "Value value"
}
],
"deployedAppCount": 0,
"isAssigned": true
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new TargetedManagedAppConfiguration
{
OdataType = "#microsoft.graph.targetedManagedAppConfiguration",
DisplayName = "Display Name value",
Description = "Description value",
Version = "Version value",
CustomSettings = new List<KeyValuePair>
{
new KeyValuePair
{
OdataType = "microsoft.graph.keyValuePair",
Name = "Name value",
Value = "Value value",
},
},
DeployedAppCount = 0,
IsAssigned = true,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceAppManagement.TargetedManagedAppConfigurations.PostAsync(requestBody);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc device-app-management targeted-managed-app-configurations create --body '{\
"@odata.type": "#microsoft.graph.targetedManagedAppConfiguration",\
"displayName": "Display Name value",\
"description": "Description value",\
"version": "Version value",\
"customSettings": [\
{\
"@odata.type": "microsoft.graph.keyValuePair",\
"name": "Name value",\
"value": "Value value"\
}\
],\
"deployedAppCount": 0,\
"isAssigned": true\
}\
'
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewTargetedManagedAppConfiguration()
displayName := "Display Name value"
requestBody.SetDisplayName(&displayName)
description := "Description value"
requestBody.SetDescription(&description)
version := "Version value"
requestBody.SetVersion(&version)
keyValuePair := graphmodels.NewKeyValuePair()
name := "Name value"
keyValuePair.SetName(&name)
value := "Value value"
keyValuePair.SetValue(&value)
customSettings := []graphmodels.KeyValuePairable {
keyValuePair,
}
requestBody.SetCustomSettings(customSettings)
deployedAppCount := int32(0)
requestBody.SetDeployedAppCount(&deployedAppCount)
isAssigned := true
requestBody.SetIsAssigned(&isAssigned)
targetedManagedAppConfigurations, err := graphClient.DeviceAppManagement().TargetedManagedAppConfigurations().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);
TargetedManagedAppConfiguration targetedManagedAppConfiguration = new TargetedManagedAppConfiguration();
targetedManagedAppConfiguration.setOdataType("#microsoft.graph.targetedManagedAppConfiguration");
targetedManagedAppConfiguration.setDisplayName("Display Name value");
targetedManagedAppConfiguration.setDescription("Description value");
targetedManagedAppConfiguration.setVersion("Version value");
LinkedList<KeyValuePair> customSettings = new LinkedList<KeyValuePair>();
KeyValuePair keyValuePair = new KeyValuePair();
keyValuePair.setOdataType("microsoft.graph.keyValuePair");
keyValuePair.setName("Name value");
keyValuePair.setValue("Value value");
customSettings.add(keyValuePair);
targetedManagedAppConfiguration.setCustomSettings(customSettings);
targetedManagedAppConfiguration.setDeployedAppCount(0);
targetedManagedAppConfiguration.setIsAssigned(true);
TargetedManagedAppConfiguration result = graphClient.deviceAppManagement().targetedManagedAppConfigurations().post(targetedManagedAppConfiguration);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const targetedManagedAppConfiguration = {
'@odata.type': '#microsoft.graph.targetedManagedAppConfiguration',
displayName: 'Display Name value',
description: 'Description value',
version: 'Version value',
customSettings: [
{
'@odata.type': 'microsoft.graph.keyValuePair',
name: 'Name value',
value: 'Value value'
}
],
deployedAppCount: 0,
isAssigned: true
};
await client.api('/deviceAppManagement/targetedManagedAppConfigurations')
.post(targetedManagedAppConfiguration);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\TargetedManagedAppConfiguration;
use Microsoft\Graph\Generated\Models\KeyValuePair;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TargetedManagedAppConfiguration();
$requestBody->setOdataType('#microsoft.graph.targetedManagedAppConfiguration');
$requestBody->setDisplayName('Display Name value');
$requestBody->setDescription('Description value');
$requestBody->setVersion('Version value');
$customSettingsKeyValuePair1 = new KeyValuePair();
$customSettingsKeyValuePair1->setOdataType('microsoft.graph.keyValuePair');
$customSettingsKeyValuePair1->setName('Name value');
$customSettingsKeyValuePair1->setValue('Value value');
$customSettingsArray []= $customSettingsKeyValuePair1;
$requestBody->setCustomSettings($customSettingsArray);
$requestBody->setDeployedAppCount(0);
$requestBody->setIsAssigned(true);
$result = $graphServiceClient->deviceAppManagement()->targetedManagedAppConfigurations()->post($requestBody)->wait();
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
Import-Module Microsoft.Graph.Devices.CorporateManagement
$params = @{
"@odata.type" = "#microsoft.graph.targetedManagedAppConfiguration"
displayName = "Display Name value"
description = "Description value"
version = "Version value"
customSettings = @(
@{
"@odata.type" = "microsoft.graph.keyValuePair"
name = "Name value"
value = "Value value"
}
)
deployedAppCount = 0
isAssigned = $true
}
New-MgDeviceAppManagementTargetedManagedAppConfiguration -BodyParameter $params
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
from msgraph import GraphServiceClient
from msgraph.generated.models.targeted_managed_app_configuration import TargetedManagedAppConfiguration
from msgraph.generated.models.key_value_pair import KeyValuePair
graph_client = GraphServiceClient(credentials, scopes)
request_body = TargetedManagedAppConfiguration(
odata_type = "#microsoft.graph.targetedManagedAppConfiguration",
display_name = "Display Name value",
description = "Description value",
version = "Version value",
custom_settings = [
KeyValuePair(
odata_type = "microsoft.graph.keyValuePair",
name = "Name value",
value = "Value value",
),
],
deployed_app_count = 0,
is_assigned = True,
)
result = await graph_client.device_app_management.targeted_managed_app_configurations.post(request_body)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
応答
以下は、応答の例です。 注: 簡潔にするために、ここに示す応答オブジェクトは切り詰められている場合があります。 実際の呼び出しではすべてのプロパティが返されます。
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 560
{
"@odata.type": "#microsoft.graph.targetedManagedAppConfiguration",
"displayName": "Display Name value",
"description": "Description value",
"createdDateTime": "2017-01-01T00:02:43.5775965-08:00",
"lastModifiedDateTime": "2017-01-01T00:00:35.1329464-08:00",
"id": "2444e029-e029-2444-29e0-442429e04424",
"version": "Version value",
"customSettings": [
{
"@odata.type": "microsoft.graph.keyValuePair",
"name": "Name value",
"value": "Value value"
}
],
"deployedAppCount": 0,
"isAssigned": true
}