Possible Bug in Graph Rest API

Adrien Ruffie 1 Reputation point
2023-01-07T21:36:10.38+00:00

Dear,

I'm facing to a bug, for example I tried to use the 15 november 2023 as a datetimeoffset. I keep the bug stack trace in attached file277037-error.txt

with this following code:

TimeConstraint timeConstraint = new TimeConstraint  
            {  
                TimeSlots = new List<TimeSlot>()  
                {  
                    new TimeSlot  
                    {  
                        Start = new DateTimeTimeZone()  
                        {  
                            DateTime = startDate.UtcDateTime.ToString(),  
                            TimeZone = TimeZoneInfo.Utc.ToString()  
                        },  
                        End = new DateTimeTimeZone()  
                        {  
                            DateTime = endDate.UtcDateTime.ToString(),  
                            TimeZone = TimeZoneInfo.Utc.ToString()  
                        },  
                    }  
                }  
            };  

 MeetingTimeSuggestionsResult meetingTimeSuggestionsResult = await _client.GraphServiceClient.Users[organizerEmail]  
                .FindMeetingTimes(attendeeBases, locationConstraint, timeConstraint, duration,  
                null, null, null, minimumAttendeePercentage)  
                    .Request()  
                    .Header("Prefer", "outlook.timezone=\"UTC\"")  
                    .PostAsync();  

bellow the start and end datetimeoffset provided for time constraint:
277182-datetime.png

If I try for example 08/01/2023 (so the 8 january 2023) the FindMeetingTimes return to me 01/08/2023 like a day switch to month ... and If I call "Month" on the date time offset response, I got 8 months ! Is normally ? How I can make to work with datetimeoffset plz ?

Thank a lot and have a nice day
Adrien

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,711 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Gopinath Chennamadhavuni 2,431 Reputation points
    2023-01-09T08:13:43.567+00:00

    Hi @Adrien Ruffie ,

    Thanks for reaching out.

    I could reproduce your issue if I pass the date value in "yyyy-dd-mm" format and is not in expected format. The expected date format should be "yyyy-mm-dd". Please refer the link for more details: https://learn.microsoft.com/en-us/graph/api/user-findmeetingtimes?view=graph-rest-1.0&tabs=http

    Error response same as like you with date format: "yyyy-dd-mm"
    277339-booking-error.png

    Success response with date format: "yyyy-mm-dd"

    277387-booking-successres.png

    I would suggest you to please set the date format values in expected format in request Payload.

    Hope this helps.

    If the answer is helpful, please click "Accept Answer" and kindly upvote. If you have further questions about this answer, please click "Comment".

    0 comments No comments