Hello Aron Marinescu,
You can fetch the online meeting ID by passing join web URL using Application API permissions too.
To fetch the online meeting details using OAuth2 application, make sure to:
- Create the application access policy and grant the policy, otherwise an error "No application access policy found for this app" will popup.
- Make sure to encode the join web URL and pass in the Microsoft Graph API request.
- Also, pass User ID not User Email/UPN in the Microsoft Graph API request.
- Make sure to pass JoinWebUrl not JoinUrl in the Microsoft Graph API request.
Grant OnlineMeetings.Read.All application type API permission:
Create the application access policy and grant the policy:
Active "Skype for Business Administrator role" role must be assigned to the user performing this.
Connect-MicrosoftTeams
New-CsApplicationAccessPolicy -Identity Ruk-policy -AppIds "ClientIDofApp" -Description "Ruk"
Grant-CsApplicationAccessPolicy -PolicyName Ruk-policy -Global
Generated access token using client credential flow for sample:
The online meeting ID can be fetched successfully:
https://graph.microsoft.com/v1.0/users/UserID/onlineMeetings?$filter=JoinWebUrl%20eq%20'https%3A%2F%2Fteams.microsoft.com%2Fl%2Fmeetup-join%2F19%253amexxxxxxx'
const response = await client
.api(`/users/${userId}/onlineMeetings`)
.filter(`JoinWebUrl eq '${encodedJoinWebUrl}'`)
.get();
Hope this helps!
If this answers your query, do click Accept Answer and Yes, if you have any further queries do let us know.
If you have any other questions, let me know in the “comments” and I would be happy to help you.