getting error while creating event for specific user using id

BS 20 Reputation points
2024-05-08T11:19:40.83+00:00

Hey I am trying to create an event with team meeting link to join for the given user id, below are the endpoints i have tried.

  1. /users/{user_id}/events : [ method - POST ]
  2. /users/{user_id}/calendar/events : [ method - POST ]

Now, to clarify few things I have registered the office365 account to trial version with outlook.com as domain. Then used same account for Azure and Entra Admin Center.

I have been using the below endpoint for generating oauth token.

API : https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token

The token from above API is being passed to create event API.

following is sample given in the documentation with the Example 4: Create and enable an event as an online meeting.

When the event is being created with the graph explorer but not via above mentioned endpoints.

Also when the graph explorer is used to create event it execute successfully but does not create the event as video meeting.

as per the docs it should be created because we pass the below parameters in the request.

"isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness"

and following is the error i am getting

   "error": {
"code": "OrganizationFromTenantGuidNotFound",
"message": "The tenant for tenant guid 'XXXXa30c-9c58-4ba9-9b07-28eb3877XXX' does not exist.",
"innerError": {
    "oAuthEventOperationId": "XXX587e-676e-47d9-8911-fa28be31XXX",
    "oAuthEventcV": "spilbgz92LI2HJx/iwT2Ww.1.1",
    "errorUrl": "https://aka.ms/autherrors#error-InvalidTenant",
    "requestId": "XXXX1292-7901-4f45-b4bb-fff4414eXXXX,
    "date": "2024-05-08T11:10:52"
}
}
}

where am i going wrong.

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

1 answer

Sort by: Most helpful
  1. Saranya Madhu-MSFT 225 Reputation points Microsoft Vendor
    2024-05-15T13:49:35.21+00:00

    Hi BS,

    Thanks for reaching out!

    I can understand that you are using events endpoint to create a meeting and as per the document isOnlineMeeting set to true Microsoft Graph initializes onlineMeeting. Similarly, onlineMeetingProvider Microsoft Graph initializes onlineMeeting.

    Check for the detailed description of properties from here: https://learn.microsoft.com/en-us/graph/api/resources/event?view=graph-rest-1.0#properties

    'OrganizationFromTenantGuidNotFound' occurs when your Azure AD does not have Office 365 account to work. Therefore, it cannot have /events.

    Please follow the below steps:

    Note: After you purchase an O365 license for your tenant, you also need to assign it to users, and only users who are assigned O365 licenses can use Exchange mailboxes

    Hope this helps.

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

    0 comments No comments