Forum Discussion
Update Intune Managed Device Category with Microsoft Graph were Failed
- Mar 13, 2019
In addition to what Oliver said, here's how if you want to do it through Graph API:
1. Create the category
Request URL : https://graph.microsoft.com/beta/deviceManagement/deviceCategories
Request Method: POST
Request Payload: {displayName: "testCategory(displayNameOfCategory)"}
Sample response:
{
"@odata.context":"https://graph.microsoft.com/beta/$metadata#deviceManagement/deviceCategories/$entity",
"id":"11111111-1111-1111-1111-111111111111(TakeThisIDItIsYourDeviceCategoryID)",
"displayName":"testCategory",
"description":null
}
Or Get categories if created already
Request URL : https://graph.microsoft.com/beta/deviceManagement/deviceCategories
Request Method: GET
Sample response:
{
"@odata.context":"https://graph.microsoft.com/beta/$metadata#deviceManagement/deviceCategories",
"value":[{"id":"11111111-1111-1111-1111-111111111111","displayName":"testCategory","description":null}]
}
2. Set the category for device
Request Method: PUT
Request Payload: {@odata.id: "https://graph.microsoft.com/beta/deviceManagement/deviceCategories/11111111-1111-1111-1111-111111111111(DeviceCategoryId)"}
Sample response: 204
Hi,
you have to create the category first in Intune before you can assign it to a device:
otherwise you are not seeing it and assignment is not allowed:
I think this constrained is the same when doing it via graph.
best,
Oliver