I'm trying to send a post request in PowerShell to https://graph.microsoft.com/beta/deviceAppManagement/mobileApps using the Graph API for the android managed store app but I keep getting an error. This works for other odata.types but not for androidManagedStoreApp. Here is my JSON data:
{
"@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": []
}
For reference I've followed the way the data is formatted on MS's
PowerShell code:
$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
This is the error I'm receiving:
Invoke-WebRequest : { "error": { "code": "BadRequest", "message": "{\r\n \"_version\": 3,\r\n \"Message\": \"An error has occurred - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 - Activity ID: 64234aa8-4195-4a11-a900-3ae515c385ee - Url: htt ps://fef.amsua0202.manage.microsoft.com/AppLifecycle/StatelessAppMetadataFEService/deviceAppManagem ent/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", "date": "2020-04-23T19:37:40" } } }