none
How do I get my app to send calendar invites without having a user sign in? RRS feed

  • Question

  • My company uses Office 365. I need my .Net app to periodically send Outlook calendar invites. Examples online show how to send an event for a user that signs into their Office 365 account. I do not want the app to send invites for a user that signs in.  

    How would I go about sending an calendar invite from a service account or some other type of account made just for the app itself? This is an internal website.


    • Edited by MrOnosa Wednesday, May 3, 2017 12:43 AM
    Wednesday, May 3, 2017 12:42 AM

Answers

  • I think I have been using the wrong tool for the job.

    An internal website should use the EWS Managed API, not the Office 365 Rest API, to do what I want to do. 

    • Marked as answer by MrOnosa Thursday, May 4, 2017 2:13 PM
    Thursday, May 4, 2017 2:11 PM

All replies

  • Hi MrOnosa,

    to create and send meeting request you can refer example below.

     private void ThisAddIn_Startup(object sender, System.EventArgs e)
            {
                Outlook.AppointmentItem agendaMeeting = (Outlook.AppointmentItem)
                    this.Application.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.
                    olAppointmentItem);
    
                if (agendaMeeting != null)
                {
                    agendaMeeting.MeetingStatus =
                        Microsoft.Office.Interop.Outlook.OlMeetingStatus.olMeeting;
                    agendaMeeting.Location = "Conference Room";
                    agendaMeeting.Subject = "Discussing the Agenda";
                    agendaMeeting.Body = "Let's discuss the agenda.";
                    agendaMeeting.Start = new DateTime(2005, 5, 5, 5, 0, 0);
                    agendaMeeting.Duration = 60;
                    Outlook.Recipient recipient =
                        agendaMeeting.Recipients.Add("Nate Sun");
                    recipient.Type =
                        (int)Outlook.OlMeetingRecipientType.olRequired;
                    ((Outlook._AppointmentItem)agendaMeeting).Send();
                }
            }
    

    How to: Programmatically Create a Meeting Request

    How to: Create a Meeting Request, Add Recipients, and Specify a Location

    I did not understand properly, "how to send an event for a user that signs into their Office 365 account. I do not want the app to send invites for a user that signs in."

    does that means if users are logged in with office365 account then they will get the request and who logged in with other id not able to receive the request?

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, May 4, 2017 7:43 AM
  • I think I have been using the wrong tool for the job.

    An internal website should use the EWS Managed API, not the Office 365 Rest API, to do what I want to do. 

    • Marked as answer by MrOnosa Thursday, May 4, 2017 2:13 PM
    Thursday, May 4, 2017 2:11 PM