How to call "findMeetingTimes" API?

Chris Shang 1 Reputation point
2020-07-30T02:12:55.233+00:00

When called the "/users/{id|userPrincipalName}/findMeetingTimes" API using token that got by "Get access without a user" channel, there was a error like bellow,

14395-image.png

The document about Microsoft Graph said this API not support the "Application" permission, if yes, how can I call the "/users/{id|userPrincipalName}/findMeetingTimes" API without letting the user log in?

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. soumi-MSFT 11,831 Reputation points Microsoft Employee Moderator
    2020-07-30T10:27:44.447+00:00

    @ChrisShang-4172, Thank you for reaching out. The following error says "Invalid user address", it means that you might not listing the meeting times for yourself but rather someone else. This API would only be able to list meetingTimes for the user who has got the token from Azure AD. In the userId/userPrincipalName section if you put down your own UPN or the UPN of the user who has requested the token from AAD (which is used as bearer token to call this api), it should get you a result and http status 200 Ok.

    Please refer to the screenshot below:

    14588-findmeetingtimes.png

    Hope this helps.

    Do let us know if this helps and if there are any more queries around this, please do let us know so that we can help you further. Also, please do not forget to accept the response as Answer; if the above response helped in answering your query.


  2. Chris Shang 1 Reputation point
    2020-07-31T07:35:42.867+00:00

    Hi @soumi-MSFT ,
    Thank you very much for your feedback.
    Initially, I wanted to use the service account to get the access token programmatically in the background, and then using the token to get calendar information about the user. Follow the documentation steps(https://learn.microsoft.com/en-us/graph/auth-v2-service?view=graph-rest-1.0), through the authorization("Calendars.Read" permission) of the administrator, I also successfully obtained token.

    When I use this token to access other people's information through the "getSchedule" API, it works.
    14813-image.png

    But when I use this token calling "findMeetingTimes" API, no matter whose information was obtained, the error occurred.

    14851-image.png


  3. Chris Shang 1 Reputation point
    2020-08-07T07:17:46.93+00:00

    Thanks for your reply @soumi-MSFT , the token obtained by using the Authorization-Code Grant Flow successfully calls the "findMeetingTimes" API.

    Reference: https://learn.microsoft.com/en-us/graph/auth-v2-user?view=graph-rest-1.0


  4. Alessandro Villa 0 Reputation points
    2023-06-05T22:02:26.1466667+00:00

    Hello, can you please elaborate how you fixed it? because I'm getting the same error: BadArgument, Invalid user address, UnsupportedScenario.

    I'm using the OAuth2, is working fine with several endpoints such as: getSchedule, events, etc. But doesn't work with findMeetingTimes. I also have the delegate rights for calendar.ReadWrite and User.Read. So, I don't know what is missing.

    0 comments No comments

Your answer

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