Calendar Access using Graph API - microsoft-graph-api

We have an application for the user to book/Edit/Cancel Room mailbox meeting from the portal.
So the user should be able to create a calendar event in the room mailbox and all participants should receive the meeting invite
Could you please advise What permission is required on Graph API other than "Calendars.ReadWrite"

According to the document about creating an online meeting, I tried to call the api and it worked with Calendars.ReadWrite permission, here's the detail.
Creating an Azure Ad app and add api permission
Get the access token , please note I just set ReadWrite as scope.
Call the api according to the document above and will get success response, you can open outlook and find meeting has created in calendar.
And here is my url and parameter:
Post:https://graph.microsoft.com/v1.0/me/events
Authorization:Bearer <access token>
Prefer:outlook.timezone="Pacific Standard Time"
Content-Type:application/json
body:{
"subject": "Prep for customer meeting",
"body": {
"contentType": "HTML",
"content": "Does this time work for you?"
},
"start": {
"dateTime": "2020-11-20T13:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2020-11-20T14:00:00",
"timeZone": "Pacific Standard Time"
},
"location":{
"displayName":"Cordova conference room"
},
"attendees": [
{
"emailAddress": {
"address":"AdeleV#contoso.OnMicrosoft.com",
"name": "Adele Vance"
},
"type": "required"
}
],
"allowNewTimeProposals": true,
"isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness"
}

Related

How to allow Microsoft Team attendees to bypass lobby programatically (Microsoft Graph)

I've created an event on a calendar using Calendar API which in turn in the response, it will give me the link to a Microsoft Team meeting link. This is an example data that I've send when creating the event. Also, I'm calling this API as an App not as a user, so basically all 3 attendees are not part of the AD users.
{
"attendees": [
{
"type": "required",
"emailAddress": {
"address": "attendee1#domain.com",
"name": "Attendee 1"
}
},
{
"type": "required",
"emailAddress": {
"address": "attendee2#domain.com",
"name": "Attendee 2"
}
},
{
"type": "required",
"emailAddress": {
"address": "attendee3#domain.com",
"name": "Attendee 3"
}
}
],
"end": {
"dateTime": "2020-11-13T17:32:39.636Z",
"timeZone": "UTC"
},
"start": {
"dateTime": "2020-11-11T16:32:39.636Z",
"timeZone": "UTC"
},
"subject": "My online meeting",
"isOnlineMeeting": true,
"body": {
"content": "Does this time work for you?",
"contentType": "HTML"
},
"onlineMeetingProvider": "teamsForBusiness",
"allowNewTimeProposals": false
}
In the response, I receive something like this:
...
"onlineMeeting": {
"joinUrl": "https://teams.microsoft.com/l/meetup-join/19%3ameeting_NzRmMDIwMWEtNGYyZS00MmNkLTk3NTAtOGxxxxkOGQ4ZDUx%40thread.v2/0?context=%7b%22Tid%22%3a%22b82fec80-bee7-401e-xxxx-8a312e0a62d1%22%2c%22Oid%22%3a%22112d58ba-xxxx-47ce-a1a8-3d0abebead18%22%7d"
}
...
My problem right now is none of the attendees can start the meeting. I wonder if there's a way programatically either when I'm creating the event or updating the online meeting, to enable the attendees to bypass the lobby and start the meeting.
According to your parameter, I think you use Calendar event api to create an online meeting.
I also tried this and found that the attendees needs permission to enter the meeting room while the creater can enter directly. I googled and found no graph api could modify this configuration. The only way to make every attendee join the meeting without permission is changing the meeting option as 'everyone can bypass the lobby'
By the way, admin role account can login the Microsoft teams admin center and automatically allow people in your organization bypass the lobby. This document tells the detail.
Actually, I used Fiddler to catch the changing option request and got a url like https://teams.microsoft.com/api/mt/amer/beta/meetings/v1/options/.... and an access token. I can use them to change the option successfully by sending a http post request. All seems the answer will appear but unfortunately after analizing the access token I found the api needs a permission https://api.spaces.skype.com which is not supported by Azure ad.

Creating events in calendar with Graph API returns "ResourceNotFound"

I'm trying to create events in my personal calendar (Office 365 account) with Graph API. I create a instance on my tenant on Azure with the following delegated permissions: Calendars.Read, Calendars.ReadWrite, email, offline_access, openid, profile and User.Read.
The oAuth2 sign-in occours as expected and I receive both the bearer_token and the refresh_token, using the /.default scope. But when I try to make the request:
POST /v1.0/me/calendar/events HTTP/1.1
Host: graph.microsoft.com
Authorization: Bearer eyJ0eXAi...
Content-Type: application/json
{
"subject": "Example",
"body": {
"contentType": "text",
"content": "Example description"
},
"start": {
"dateTime": "2020-09-01T12:00:00.000Z",
"timeZone": "America/Sao_Paulo"
},
"end": {
"dateTime": "2020-09-01T13:00:00.000Z",
"timeZone": "America/Sao_Paulo"
},
"location": {
"displayName": "Example location",
"locationUri": "https://example/uri"
}
}
I get this response:
{
"error": {
"code": "ResourceNotFound",
"message": "Resource could not be discovered.",
"innerError": {
"date": "2020-08-31T22:18:15",
"request-id": "f03d0bdf-1a9c-41f4-a236-1c5a41a5d286"
}
}
}
I already had discarted that is a mailbox problem, because with Graph Explorer I can make the request and change my calendar, so I'm willing to think that is a permission problem.
I found out, the problem was not with the Graph request, but with the authentication request.
When you log into Graph API with a coorporative account, the requests to get the bearer_token are:
https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/authorize
https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token.
But when you use a personal account, the endpoints are:
https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize
https://login.microsoftonline.com/consumers/oauth2/v2.0/token.
Using the tenantId will authenticate, but the user data will not be found in the tenant, giving the error I got.

Try to call create event using graph api with isOnlineMeeting false for MS Teams

Getting isOnlineMeeting false while send isOnlineMeeting true whe we create the event using Graph API.
Could not reproduce the issue while creating a calendar event using Graph API. Kindly confirm if you are able to still reproduce it on your end.
Used the below query to create a new event:
POST https://graph.microsoft.com/v1.0/me/calendars/{id}/events
Request Body:
{
"subject": "Test Create Event",
"IsOnlineMeeting": "True",
"onlineMeetingProvider": "teamsForBusiness",
"body": {
"contentType": "HTML",
"content": "Does this time work for you?"
},
"start": {
"dateTime": "2020-12-18T12:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2020-12-18T14:00:00",
"timeZone": "Pacific Standard Time"
},
"location": {
"displayName": "Conf Room 1"
},
"attendees": [
{
"emailAddress": {
"address": "abc#mxxxxxxx.com",
"name": "Someone"
},
"type": "required"
}
]
}
Outcome: Was able to create a new calendar event with IsOnlineMeeting value set to true.
In case you are trying to update an existing calendar event, there is a known issue in that, where the isOnlineMeeting value keeps toggling between true and false for each update/patch request.
In that case, do not update the body in the request, and it should work.
There is an open bug for the update event issue.
Please refer -> Microsoft team link is not appearing for alternate update calendar events
Had the same problem, I add to add these permissions to the app I was using to create the meeting events:
TeamSettings.Read.All, TeamSettings.ReadWrite.All
As soon as I added them, isOnlineMeeting was correctly set to true, and onlineMeetingProvider was set to teamsForBusiness, as specified in the request.
onlineMeetingUrl is always null, but it's possible to get the meeting url from the "onlineMeeting.joinUrl" property, which is automatically populated by the API.

Eventbrite - Publish an event using using REST API

I am able to create an event using the REST API , but when I try to publish it using the API I am getting "There are errors with your arguments: event.tickets - MISSING" . Documentation says the tickets are required , But I don't see an option to pass the event.tickets in API ( I don't want to login to eventbrite and set the tickets after the event is created) . Thanks for your help.
To create an event ( Body parameters are given below )
https://www.eventbriteapi.com/v3/events/?token=mytokenid
"event" : {
"name": {
"html": "Here is an event name"
},
"start": {
"timezone": "America/Chicago",
"utc": "2018-08-03T00:00:00Z"
},
"end": {
"timezone": "America/Chicago",
"utc": "2018-08-03T03:00:00Z"
},
"currency": "USD",
"capacity":10
}
To publish the above event( This is one throwing the error)
https://www.eventbriteapi.com/v3/events/99999999(eventid)/publish/?token=mytoken
Got the solution for it , before publishing you have to call the tickets api to add the tickets ,
So here is the order to publish an event
1) Create event - https://www.eventbriteapi.com/v3/events/?token=mytoken
2) Add tickets to the above event - https://www.eventbriteapi.com/v3/events/aboveeventid/ticket_classes/?token=mytoken
3) Publish the above event - https://www.eventbriteapi.com/v3/events/aboveeventid/publish/?token=mytoken

"Exception has been thrown by target of an invocation" for /findMeetingTimes request

I am developing a multi-tenant application with the Microsoft Graph API that makes use of the /findMeetingTimes endpoint. After many months of successful requests, on January 15th I started to see some errors coming through for a specific kind of request for some users.
The failing request is a POST to /findMeetingTimes for a single attendee who is the user on who's behalf I'm making the request. The same requests for more than a single attendee are still completing just fine, even if the user who authorized the request is included.
Nothing has changed in my request so this seems like it's either a change on the API side or a change in the user's configuration that's broken their ability to make requests of this type. Any insight on this error in this context would be helpful!
POST https://graph.microsoft.com/v1.0/me/findMeetingTimes
Request body:
{
"attendees": [
{
"emailAddress": {
"address": "[email of user who authorized the request]"
},
"type": "Required"
}
],
"meetingDuration": "PT30M",
"minimumAttendeePercentage": 100,
"maxCandidates": 400,
"timeConstraint": {
"timeslots": [
{
"start": {
"dateTime": [DateTime],
"timeZone": "UTC"
},
"end": {
"dateTime": [DateTime],
"timeZone": "UTC"
}
}
],
"activityDomain": "Unrestricted"
}
}
Returns (one specific example):
500: "Exception has been thrown by the target of an
invocation.", "innerError":{"request-id":"a039234e-f64e-489a-96cf
ff4f686a4389","date":"2018-01-18T01:51:49"}

Resources