An API that connects multiple Microsoft services, enabling data access and automation across platforms
How do I retrieve multiple graph users selected using custom extensions?
I want to retrieve a set of graph Users using the latest graph SDK. The result should have the custom attributes (extension_XYZ_attributeName) for the users.
This works (single user)
user = graphClient.users().byUserId("some_user_id").get(requestConfiguration -> {
rqueryParameters.select = new String[] {"id", "extension_appId_myuserid"}; });
This does not work (multiple returned users)
userCollectionResponse = graphClient.users().get(r -> {
r.queryParameters.select = new String[] {"id", "extension_appId_myuserid"};
});
The symptom is that the thread appears to be stuck during the execution of .get(...).
If the "extension_appId_myuserid" is removed, the call works (both for a single user and multiple returned users).
If the logic uses
graphClient.users().get()
then users are returned, albeit without any custom extension values.
Using Postman, this works:
https://graph.microsoft.com/v1.0/users?$select=id, extension_appId_myuserid
The returned set of users contain the custom attribute.
Using a previous version of the SDK works:
builder.buildRequest().select(selectedUserFields).get().getCurrentPage();
where selectedUserFields is "id, extension_appId_myuserid"
Please let me know what modifications I need to make to get the same results as in the previous version of the SDK.
Thanks,
Thorsten