我正在尝试使用 Android 托管商店应用程序的 Graph API 将 PowerShell 中的发布请求发送到https://graph.microsoft.com/beta/deviceAppManagement/mobileApps,但我一直收到错误消息。这适用于其他 odata.types 但不适用于 androidManagedStoreApp。这是我的 JSON 数据:
{
"@odata.type": "#microsoft.graph.androidManagedStoreApp",
"displayName": "Microsoft Excel",
"description": "Create Spreadsheets yo",
"publisher": "Microsoft Corporation",
"largeIcon": {
"@odata.type": "microsoft.graph.mimeContent",
"type": "Type value",
"value": "dmFsdWU="
},
"isFeatured": false,
"privacyInformationUrl": "https://play.google.com/store/apps/details?id=com.microsoft.office.excel&hl=en_US",
"informationUrl": "https://play.google.com/store/apps/details?id=com.microsoft.office.excel&hl=en_US",
"owner": 'james',
"developer": 'james',
"notes": 'james',
"uploadState": 0,
"publishingState": "processing",
"isAssigned": false,
"roleScopeTagIds": [
],
"dependentAppCount": 0,
"packageId": "com.microsoft.office.excel",
"appIdentifier": "com.microsoft.office.excel",
"usedLicenseCount": 0,
"totalLicenseCount": 1,
"appStoreUrl": "https://play.google.com/store/apps/details?id=com.microsoft.office.excel&hl=en_US",
"isPrivate": false,
"isSystemApp": false,
"supportsOemConfig": false,
"appTracks": []
}
作为参考,我遵循了数据在 MS 上的格式
PowerShell代码:
$JSONData = Get-Content "C:\Kits\Excel.json"
$Endpoint = "https://graph.microsoft.com/beta/deviceAppManagement/mobileApps"
Invoke-WebRequest -Uri $Endpoint -Headers $Global:AuthToken -Method Post -Body $JSONData
这是我收到的错误:
Invoke-WebRequest : { "error": { "code": "BadRequest", "message": "{\r\n \"_version\": 3,\r\n \"Message\": \"一个错误已发生 - 操作 ID(用于客户支持):00000000-0000-0000-0000-000000000000 - 活动 ID:64234aa8-4195-4a11-a900-3ae515c385ee - 网址:htt ps://fef.amsua0202.manage.microsoft.com /AppLifecycle/StatelessAppMetadataFEService/deviceAppManagement/mobileApps?api-version=5020-03-19\",\r\n \"CustomApiErrorPhrase\": \"\",\r\n \"RetryAfter\": null,\ r\n \"ErrorSourceService\": \"\",\r\n \"HttpHeaders\": \"{}\"\r\n}", "innerError": { "request-id": "64234aa8 -4195-4a11-a900-3ae515c385ee”,“日期”:“2020-04-23T19:37:40”}}}