How to find Event using the joinUrl

Hariharan Rajkumar [external] 5 Reputation points
2024-02-05T11:15:34.35+00:00

My users create Calendar Invites (either via teams or outlook) and store the JoinUrl in a Sharepoint List for later reference.   My goal is to programmatically find the event that was created with this JoinUrl.

While I can easily locate the corresponding online meeting using graph api (filtering on JoinWebUrl), I haven't found a way to locate the corresponding Calendar Event.    I have tried variations of this with no success.

https://graph.microsoft.com/v1.0/users/{userid}/events?filter=onlineMeeting eq '{meeting join url}'
I know that joinUrl sit within onlineMeeting. I even recall, having receid an error messafge saying onlineMeeting cannot be searched. Any ideas to accomplish this task or better way to proceed are welcome !

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,627 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,445 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,065 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. CarlZhao-MSFT 40,311 Reputation points
    2024-02-06T10:12:39.06+00:00

    Hi @Hariharan Rajkumar [external]

    You can get the event set first, and then use that 'joinUrl' to filter the event set to get the target event.

    For example:

    try {
    
        var result = await graphClient.Users["{user id}"].Events.GetAsync();
    
        var joinUrl = "{joinUrl}";
    
        if (result != null && result.Value != null)
        {
            foreach (var events in result.Value)
            {
                if (events.OnlineMeeting != null && events.OnlineMeeting.JoinUrl != null && events.OnlineMeeting.JoinUrl.Equals(joinUrl))
                {
                    Console.WriteLine(events.Id);
                }
            }
        }
        else
        {
            Console.WriteLine("No events found.");
        }
    
    }
    
    catch (ODataError odataError)
    {
        Console.WriteLine(odataError.Error.Code);
        Console.WriteLine(odataError.Error.Message);
    
    
    }
    

    User's image

    Hope this helps.

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


  2. Prasad-MSFT 6,111 Reputation points Microsoft Vendor
    2024-02-28T11:14:37.0333333+00:00

    It is not possible to directly find a calendar event using the JoinWebUrl.

    One way to find the calendar event is to search for the event in the user's calendar using the Microsoft Graph API and filter the results based on the subject, date, and time of the event. You can also try to search for the event in the user's calendar by looking for the JoinWebUrl in the event body.

    Thanks, 

    Prasad Das

    ************************************************************************* 

    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.

    0 comments No comments