This repository was archived by the owner on Apr 4, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
This repository was archived by the owner on Apr 4, 2025. It is now read-only.
Body for GetPresencesByUserId blank #114
Copy link
Copy link
Open
Labels
Description
I have the following code:
context = MicrosoftKiotaAuthenticationOAuth::ClientCredentialContext.new(
ENV.fetch("MICROSOFT_TENANT_ID"),
ENV.fetch("MICROSOFT_CLIENT_ID"),
ENV.fetch("MICROSOFT_CLIENT_SECRET")
)
authentication_provider = MicrosoftGraphCore::Authentication::OAuthAuthenticationProvider.new(context, nil, ["https://graph.microsoft.com/.default"])
adapter = MicrosoftGraphBeta::GraphRequestAdapter.new(authentication_provider)
client = MicrosoftGraphBeta::GraphServiceClient.new(adapter)
begin
body = MicrosoftGraphBeta::Communications::GetPresencesByUserId::GetPresencesByUserIdPostRequestBody.new
body.ids = users.collect { |user| user[:id] }
request = client.communications.get_presences_by_user_id.post(body)
result = request.resume
rescue => e
puts e.error
endNote: I'm not showing the list of users above, but users is an array of hashes I'm pulling from for testing this example.
But it outputs:
#<MicrosoftGraphBeta::Models::ODataErrorsMainError:0x0000ffff92322638
@additional_data={},
@code="InvalidArgument",
@inner_error=
#<MicrosoftGraphBeta::Models::ODataErrorsInnerError:0x0000ffff92322368
@additional_data={"date"=>"2024-06-05T15:00:32"},
@client_request_id="<REDACTED>",
@request_id="<REDACTED>">,
@message="[ids]: Required property 'ids' not found in JSON. Path '', line 1, position 2.">
If I look at the body I will see the ids in the array, but for some reason serialization isn't working?
I tested the serializer and that seems to work fine, but its something about GetPresencesByUserIdRequestBuilder.to_post_request_information#56 as the line seems to the what actually uses it, but the content if I manually call it :
ri = client.communications.get_presences_by_user_id.to_post_request_information(body)
is blank:
irb(main):255> ri.inspect
=> "#<MicrosoftKiotaAbstractions::RequestInformation:0x0000ffff974b89e8 @headers=#<MicrosoftKiotaAbstractions::RequestHeaders:0x0000ffff974bfb80
@headers={\"Accept\"=>[\"application/json\"], \"Content-Type\"=>[\"application/json\"]}>,
@query_parameters={},
@path_parameters={\"baseurl\"=>\"https://graph.microsoft.com/beta\"},
@url_template=\"{+baseurl}/communications/getPresencesByUserId\",
@http_method=:POST,
@content=\"{}\">"
I'm not sure if I'm doing something wrong or this is broken. Let me know if you need more details.