Outlook add in: remove a calendar event - events

I have an Outlook add in to create a calendar event from my task pane.
Once created, I would like to delete the event in some cases. Must I use the graph api to do that?
If so, I have seen in the API:
DELETE /users/{id | userPrincipalName}/events/{id}
I have the 'event id', but I need the user id (or userPrincipalName). What I can get from Office.context.mailbox.userProfile is 'displayName' & 'emailAddress'
Besides, I need a Bearer header, but how can I get that token with my add in info?
Maybe I can delete the event differently...
Thanks in advance,
Diego

We don't have addin (OfficeJS) API to delete the calendar event. You can achieve this using REST API. Please check this on how to use REST APIs from Outlook Addin. You will need to use getCallbackTokenAsync() addin API to get the REST Token.

Related

Outlook / Exchange API (Microsoft Graph?)

I am making a quick program that can check another users Outlook calendar and book an appointment. The booking part is fine, but I am looking at a way to return other users calendar information, without having to link a calendar to Outlook first.
I was thinking that there would be an API or a way to access this information either via 365 or the exchange server. There is this (https://learn.microsoft.com/en-us/previous-versions/office/office-365-api/?redirectedfrom=MSDN#Getevents) but it doesn't seem to do what I am after and is also deprecated with an end date within a year
I have read about Microsoft Graph but in reading it refers to 'users calendar', can this do calendars for a specific user that isn't me?
GET /me/calendar/calendarView?startDateTime={start_datetime}&endDateTime={end_datetime}
If so, does anyone know how?
Thank you
You can access user's calendar by calling the following endpoint
GET /users/{id | userPrincipalName}/calendarView?startDateTime={start_datetime}&endDateTime={end_datetime}
Resource:
List calendarView

Outlook office-js how to forward selected email and add a recipient

I am new to outlook office-js, and I am trying to get a selected email from a button click and forward the email. I am trying to find an example of how to get the selected email. I have done COM add-ins, and I guess I am looking for an explorer object. Any help would be greatly appreciated. Thanks, Tom
For forwarding an item, you can use the Office.context.mailbox.item.itemId API to get the item ID and using REST make an API call. There is a concept page on calling REST APIs from an outlook add-in.

Google Api Calendar add Attendee

i am trying to add an attendee to a existing event using the google calendar api, i am using php, the problem is all existing attendees get an email notification of the updated event, any idea how to send the notification to the new attendee only?
This is possible directly in gmail like this:
enter image description here
Any help is appreciated
Use Patch, instead of update:
https://developers.google.com/google-apps/calendar/v3/reference/events/patch

Get all changes to calendar in Outlook Web Add-in

I'm developing an add-in for Outlook Web (Outlook365 and Outlook.com) which needs to retrieve all changes in the calendar.
I tried to use the Calendar REST API, but when calling getCallbackTokenAsync to get the access token, the token I get is scoped, and when I call the Calendar REST API, I get this error:
{"error":{"code":"ErrorAccessDenied","message":"The api you are trying to access does not support item scoped OAuth."}}.
Does anyone have an idea about this or another way to get changed items?
I have same issue with this , just about attachments.
You need to set permissions of 'ReadWriteMailbox' in your manifest and then it's supposed to return 200 and not error..but right now there is a bug in outlook.
Read more here: Can't add attachment to message in outlook add-in using Outlook rest API
Good luck .

How to get contact's "FreeBusyStatus" in Microsoft Outlook using REST Api?

See above mentioned image, it gives different status but don't know how to get it.
Check Outlook API.
Thanks in advance :-)
You can use GET https://outlook.office.com/api/v2.0/me/events/{event_id}?$select=ShowAs to retrieve the FreeBusyStatus of attendee(yourself) for a particular meeting, the return type is something like below,
If you want to check the response from a particular attendee, use GET https://outlook.office.com/api/v2.0/me/events/{event_id}?$select=ShowAs,Attendees, and check on the "Response" from the "Status" response.
This enumeration is used for 'Specifies the availability status of an attendee for a meeting.' At present, the Office 365 REST API is not able to retrieve the contacts' meetings status. And you can submit the feedback from here if you want to the Office 365 REST to support this feature.
We are able to add other’s users’ calendar manually, then we could see the status of the appoint/meet of him/her. Here is an figure that show the others calendar for your reference:
If you want to retrieve the free/busy information of EWS is a possible workaround. Please refer to here for more detail. And if you require these information to schedule a meeting, you can try to use the Find meeting times (preview).

Resources