Share via

Java SDK with BaseRequest<Boolean> objects

Eran-9007 20 Reputation points
2025-01-13T10:25:52.2433333+00:00

Hi

I'm using Java & Graph API

I try to call for https://learn.microsoft.com/en-us/graph/api/channel-doesuserhaveaccess?view=graph-rest-1.0&tabs=http

But the successful response always result null.

I debugged the http stream and I see a successful response

{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Edm.Boolean", "value": true }

I also removed the odata.contex by header but still it result none

Accept: application/json;odata.metadata=none

My Code:

ChannelDoesUserHaveAccessRequest
 request = graphClient.teams(teamId)
        .channels(channelId)
        .doesUserHaveAccess(
                ChannelDoesUserHaveAccessParameterSet.newBuilder()
                        .withUserId(userId)
                        .build())
        .buildRequest()
return request.get()

Notice this request will generate "ChannelDoesUserHaveAccessRequest" which try to convert the result json directly to Boolean!

SDK details:

SdkVersion:graph-java/v5.80.0 
SdkVersion:
User-Agent:

Thanks,

Eran

Microsoft Security | Microsoft Graph
0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.