我一直在尝试使用Microsoft的Graph API针对使用PowerShell的androidManagedStoreApp发出POST请求。 MS Documentation on the endpoint here
问题是我总是收到错误的请求。这是我的JSON obj:
{
"@odata.type": "#microsoft.graph.androidManagedStoreApp",
"displayName": "Adobe Acrobat Reader: PDF Viewer, Editor Creator",
"description": "Send PDFs for e signatures, edit on the go help save battery with dark mode.",
"publisher": "Adobe",
"isFeatured": false,
"privacyInformationUrl": null,
"informationUrl": "https://play.google.com/store/apps/details?id=com.adobe.reader",
"owner": null,
"developer": null,
"notes": null,
"roleScopeTagIds": [
"0"
],
"dependentAppCount": 0,
"packageId": "com.adobe.reader",
"appIdentifier": "com.adobe.reader",
"appStoreUrl": "https://play.google.com/store/apps/details?id=com.adobe.reader",
"isPrivate": false,
"isSystemApp": false,
"supportsOemConfig": false,
"largeIcon": {
"@odata.type": "#microsoft.graph.mimeContent",
"type": "image/jpeg",
"value": ""
},
"appTracks": [
]
}
我几个月以来一直在尝试这样做,但最初放弃了。但是今天我尝试只用第一行发送请求,如下所示:
{ "@odata.type": "#microsoft.graph.androidManagedStoreApp",}
,这给我消息“此应用类型不支持POST请求”。有人有这个工作吗?此端点仅不适用于androidManagedStoreApps吗?
我的powershell代码很简单:
$JsonData = Get-Content "C:\Kits\AndroidStoreapp.json"
Invoke-RestMethod -Uri "https://graph.microsoft.com/beta/deviceAppManagement/mobileApps" -Headers $Global:AuthToken -Method Post -Body $JsonData
预先感谢