Example #1
0
        /// <summary>
        /// Creates a new thread in the conversation flow of a target Office 365 Group
        /// </summary>
        /// <param name="groupId">The ID of the target Office 365 Group</param>
        public static void SendMessageToGroupConversation(String groupId, String accessToken = null)
        {
            var conversation = new Conversation
            {
                Topic = "Let's manage this Business Project!",
                Threads = new List<ConversationThread>(
                    new ConversationThread[] {
                                new ConversationThread
                                {
                                    Topic = "I've just created this Business Project",
                                    Posts = new List<ConversationThreadPost>(
                                        new ConversationThreadPost[]
                                        {
                                            new ConversationThreadPost
                                            {
                                                Body = new ItemBody
                                                {
                                                    Content = "<h1>Welcome to this Business Project</h1>",
                                                    Type = BodyType.Html,
                                                },
                                            }
                                        })
                                }
                    })
            };

            MicrosoftGraphHelper.MakePostRequest(
                String.Format("{0}groups/{1}/conversations",
                    MicrosoftGraphHelper.MicrosoftGraphV1BaseUri, groupId),
                    conversation, "application/json", accessToken);
        }
Example #2
0
 public static void SendMessageToGroupConversation(String groupId, Conversation conversation, String accessToken = null)
 {
     String jsonResponse = MicrosoftGraphHelper.MakePostRequestForString(
         String.Format("{0}groups/{1}/conversations",
             MicrosoftGraphHelper.MicrosoftGraphV1BaseUri, groupId),
             conversation, "application/json", accessToken);
 }