msgraph-sdk-go
msgraph-sdk-go copied to clipboard
Cannot expand OneDrive facet when iterating over Users
trafficstars
This may be expected, but the error I received was surprising and feels like it should not be presented to the user for this particular request.
The request I made and response:
{
"url": "https://graph.microsoft.com/v1.0/users?$expand=drive",
"method": "GET",
"status": 400,
"header": {
"Client-Request-Id": [
"94fdfed8-5405-44a1-a548-6359fc475e00"
],
"Content-Type": [
"application/json"
],
"Date": [
"Wed, 08 May 2024 13:05:47 GMT"
],
"Request-Id": [
"e7d5ccef-9379-4c12-8833-106cdebddcef"
],
"Strict-Transport-Security": [
"max-age=31536000"
],
"Vary": [
"Accept-Encoding"
],
"X-Ms-Ags-Diagnostic": [
"{\"ServerInfo\":{\"DataCenter\":\"East US\",\"Slice\":\"E\",\"Ring\":\"5\",\"ScaleUnit\":\"003\",\"RoleInstance\":\"BL6PEPF0000C451\"}}"
]
}
"body": {
"error": {
"code": "BadRequest",
"message": "User ID cannot be empty or whitespace.",
"innerError": {
"date": "2024-05-08T13:05:48",
"request-id": "e7d5ccef-9379-4c12-8833-106cdebddcef",
"client-request-id": "94fdfed8-5405-44a1-a548-6359fc475e00"
}
}
}
}
What I was trying to do was expand the OneDrive facet when iterating over users to more efficiently obtain this data, however it does not seem possible with $expand or $select
The error message, User ID cannot be empty or whitepace is not clear and seems to be surfacing due to an internal bug within the MS Graph API, rather than the user's request.
Or am I using expand incorrectly here?
Thanks!