msgraph-sdk-dotnet icon indicating copy to clipboard operation
msgraph-sdk-dotnet copied to clipboard

[Client bug]: No way to accept microsoft.graph.calendarSharingMessage

Open MartinM85 opened this issue 11 months ago • 4 comments

Describe the bug The client doesn't generate the code for the following URL

POST https://graph.microsoft.com/v1.0/me/messages/{message_id}/microsoft.graph.calendarSharingMessage/microsoft.graph.accept

To Reproduce Accept method is missing

await graphClient.Me.Messages["{calendar_sharing_message_id}"].GraphCalendarSharingMessage.Accept.PostAsync()

or

await graphClient.Me.Messages["{calendar_sharing_message_id}"].Accept.PostAsync()

Expected behavior

await graphClient.Me.Messages["{calendar_sharing_message_id}"].GraphCalendarSharingMessage.Accept.PostAsync()

Screenshots If applicable, add screenshots to help explain your problem.

Client version v5.*

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context Check the metadata

  <EntityType Name="calendarSharingMessage" BaseType="graph.message">
    <Property Name="canAccept" Type="Edm.Boolean" />
    <Property Name="sharingMessageAction" Type="graph.calendarSharingMessageAction" />
    <Property Name="sharingMessageActions" Type="Collection(graph.calendarSharingMessageAction)" />
    <Property Name="suggestedCalendarName" Type="Edm.String" />
  </EntityType>

  <Action Name="accept" IsBound="true">
    <Parameter Name="bindingParameter" Type="graph.calendarSharingMessage" />
    <ReturnType Type="graph.calendar" Nullable="false" />
  </Action>

MartinM85 avatar Aug 07 '23 06:08 MartinM85

It seems to me that the query itself doesn't work, but I didn't find where to report a bug in the Graph API.

POST https://graph.microsoft.com/v1.0/me/messages/{calendar_sharing_message_id}/microsoft.graph.calendarSharingMessage/microsoft.graph.accept

{
    "error": {
        "code": "RequestBroker--ParseUri",
        "message": "Resource not found for the segment 'Microsoft.OutlookServices.CalendarSharingMessage'."
    }
}

Response headers

{
    "cache-control": "private",
    "client-request-id": "d9645dfb-a10e-0ed3-882b-2d44a89e06a6",
    "content-type": "application/json; odata.metadata=minimal; odata.streaming=true; IEEE754Compatible=false; charset=utf-8",
    "request-id": "f52d5cb7-c489-478f-ac06-06b1169cb828"
}

MartinM85 avatar Aug 07 '23 12:08 MartinM85

@andrueastman I know it's off-topic, but is there any chance that the issue will be fixed? To be honest, I'm not sure where should I report this kind of issue. I've tried the Graph doc, Microsoft Q&A, but without any feedback for months.

MartinM85 avatar Mar 14 '24 06:03 MartinM85

@MartinM85 Any chance you can share an updated error response with the client-request-id? With that we can try to follow it up with the API team.

andrueastman avatar Mar 19 '24 06:03 andrueastman

@andrueastman Hi, I'm including more details

To filter microsoft.graph.calendarSharingMessage messages, only way is to use singleValueExtendedProperties

/v1.0/me/messages?$filter=singleValueExtendedProperties/Any(ep: ep/id eq 'String 0x001A' and ep/value eq 'IPM.Sharing')

Then when using any id of microsoft.graph.calendarSharingMessage

POST /v1.0/me/messages/{calendar_sharing_message_id}/microsoft.graph.accept

{
    "error": {
        "code": "RequestBroker--ParseUri",
        "message": "Resource not found for the segment 'microsoft.graph.accept'."
    }
}

{
    "cache-control": "private",
    "client-request-id": "76ef7f8a-988c-5a80-5979-68f41adc4461",
    "content-type": "application/json; odata.metadata=minimal; odata.streaming=true; IEEE754Compatible=false; charset=utf-8",
    "request-id": "080e85a6-d263-4ca1-ad14-047600ab3c3b"
}

Or

POST /v1.0/me/messages/{calendar_sharing_message_id}/microsoft.graph.calendarSharingMessage/microsoft.graph.accept

{
    "error": {
        "code": "RequestBroker--ParseUri",
        "message": "Resource not found for the segment 'Microsoft.OutlookServices.CalendarSharingMessage'."
    }
}

{
    "cache-control": "private",
    "client-request-id": "eca98d2b-e8e1-59a6-63ee-66d55110291b",
    "content-type": "application/json; odata.metadata=minimal; odata.streaming=true; IEEE754Compatible=false; charset=utf-8",
    "request-id": "d5548774-4a88-4f17-b559-745cfc90d9d0"
}

When comparing message and calendarSharingMessage, calendarSharingMessage contains these extra properties

{
    "@odata.type": "#microsoft.graph.calendarSharingMessage",
    "canAccept": true,
    "suggestedCalendarName": "xxx",
    "sharingMessageAction": {
        "importance": "secondary",
        "actionType": "accept",
        "action": "addThisCalendar"
    },
    "sharingMessageActions": [
        {
            "importance": "secondary",
            "actionType": "accept",
            "action": "addThisCalendar"
        }
    ]
}

MartinM85 avatar Mar 19 '24 07:03 MartinM85