/// <summary> /// This method sends an email message /// </summary> /// <param name="message"></param> public static void SendMessage(MailMessageToSend message) { MicrosoftGraphHelper.MakePostRequest( String.Format("{0}me/microsoft.graph.sendMail", MicrosoftGraphHelper.MicrosoftGraphV1BaseUri), message, "application/json"); }
/// <summary> /// This method replies to a thread of an Office 365 Group /// </summary> /// <param name="groupId">The ID of the thread</param> /// <param name="threadId">The ID of the thread</param> /// <param name="post">The post to send as the reply</param> public static void ReplyToUnifiedGroupThread(String groupId, String threadId, ConversationThreadPost post) { MicrosoftGraphHelper.MakePostRequest( String.Format("{0}groups/{1}/threads/{2}/reply", MicrosoftGraphHelper.MicrosoftGraphV1BaseUri, groupId, threadId), new { post }, "application/json"); }
/// <summary> /// This method sends a reply all to an email message /// </summary> /// <param name="messageId">The ID of the message to reply all to</param> /// <param name="comment">Any comment to include in the reply all, optional</param> public static void ReplyAll(String messageId, String comment = null) { MicrosoftGraphHelper.MakePostRequest( String.Format("{0}me/messages/{1}/replyAll", MicrosoftGraphHelper.MicrosoftGraphV1BaseUri, messageId), content: !String.IsNullOrEmpty(comment) ? new { Comment = comment } : null, contentType: "application/json"); }
/// <summary> /// This method forwards an email message to someone else /// </summary> /// <param name="messageId">The ID of the message to forward</param> /// <param name="recipients">The recipients of the forward</param> /// <param name="comment">Any comment to include in the reply all, optional</param> public static void Forward(String messageId, List <UserInfoContainer> recipients, String comment = null) { MicrosoftGraphHelper.MakePostRequest( String.Format("{0}me/messages/{1}/forward", MicrosoftGraphHelper.MicrosoftGraphV1BaseUri, messageId), content: new { Comment = !String.IsNullOrEmpty(comment) ? comment : null, ToRecipients = recipients, }, contentType: "application/json"); }
/// <summary> /// This method provides a feedback for a received meeting request /// </summary> /// <param name="calendarId">The ID of the calendar</param> /// <param name="eventId">The ID of the meeting request</param> /// <param name="feedback">The feedback for the meeting request</param> /// <param name="comment">Any comment to include in the feedback, optional</param> public static void SendFeedbackForMeetingRequest(String calendarId, String eventId, MeetingRequestFeedback feedback, String comment = null) { MicrosoftGraphHelper.MakePostRequest( String.Format("{0}me/calendars/{1}/events/{2}/{3}", MicrosoftGraphHelper.MicrosoftGraphV1BaseUri, calendarId, eventId, feedback), content: !String.IsNullOrEmpty(comment) ? new { Comment = comment } : null, contentType: "application/json"); }
/// <summary> /// This method adds a new member to a group /// </summary> /// <param name="user">The user to add as a new group's member</param> /// <param name="groupId">The ID of the target group</param> public static void AddMemberToGroup(User user, String groupId) { MicrosoftGraphHelper.MakePostRequest( String.Format("{0}groups/{1}/members/$ref", MicrosoftGraphHelper.MicrosoftGraphV1BaseUri, groupId), new GroupMemberToAdd { ObjectId = String.Format("{0}users/{1}/id", MicrosoftGraphHelper.MicrosoftGraphV1BaseUri, user.UserPrincipalName) }, "application/json"); }