• 0

Microsoft Teams: Create a new message in a channel


 Share

Question

So I am working on setting up a new (private) bot for Microsoft Teams that should be able to post messages in a channel on-demand. I already have a bot coded for Google Hangouts Chat, but Microsoft Teams is giving me a really hard time.

I've been searching for over 10 hours now all over the web, and I am very confused.

 

Right now, all I want to do is post cards to a Microsoft Teams Channel. So I created the connectorclient, I used the baseuri provided when the bot joined the channel (Starts with smba.trafficmanager.net) with my MSAppID and MSAppPassword. Then, I fill in as much information as I can (Maybe too much?) and I submit the information using the connector's .conversations.createconversation.

 

Namespaces used: Microsoft.bot.connector, Microsoft.bot.connector.teams.models

 

Here's the code:

 

 Dim Connector As New ConnectorClient(New Uri("https://smba.trafficmanager.net/amer/"), "MSAPPID", "MSAPPPASSWORD")


        Dim conversation As New ConversationParameters
        Dim activity2 = Activity.CreateMessageActivity
        Dim bot As New ChannelAccount
        bot.Id = "BOTID"
        bot.Name = "EDD Bot Test"


        conversation.Bot = bot
        Dim chaninfo As New ChannelInfo
        chaninfo.Id = "CHANID"
        chaninfo.Name = "General"
        Dim teaminfo As New TeamInfo
        teaminfo.Id = "TEAMID"
        teaminfo.Name = "EDD"
        activity2.Text = "Test"
        activity2.ServiceUrl = "https://smba.trafficmanager.net/amer/"
        activity2.Type = ActivityTypes.Message
        activity2.From = bot
        activity2.ChannelId = "msteams"
        Dim tenantdata As New TenantInfo
        tenantdata.Id = "TENANTID"
        Dim teamschanneldata As New TeamsChannelData
        teamschanneldata.Channel = chaninfo
        teamschanneldata.Team = teaminfo
        teamschanneldata.Tenant = tenantdata
        activity2.ChannelData = teamschanneldata



        conversation.Activity = activity2
        Response.Write(JsonConvert.SerializeObject(conversation))
        Try

            Dim reqresp As ConversationResourceResponse = Connector.Conversations.CreateConversation(conversation)
            Response.Write("ActivityID: " & reqresp.ActivityId & ", ServiceURL: " & reqresp.ServiceUrl & ", ID: " & reqresp.ServiceUrl)
        Catch ex As ErrorResponseException
            Response.Write(ex.Response.Content & " " & ex.Response.ReasonPhrase)
        End Try

This is what the API returns:

 

{"message":"Authorization has been denied for this request."} Unauthorized

 

Keep in mind, I'm not even 100% sure I'm using the right method to create the channel message, I figured it was either CreateConversation or ReplyToActivity.

I gave the app Users.ReadWriteAll permissions too, so am I missing something? That error leads me to think it doesn't have anything to do with the ConversationParameters payload but something to do with authentication.

 

Thank you.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 1

This was fixed btw. It seems I needed to added a trust for the serviceurl.

 

Or my service url.

 

Truth be told, to hell with the specifics. It works.

 

The command that helped, to be added before the connector:

 

            MicrosoftAppCredentials.TrustServiceUrl

 

Link to comment
Share on other sites

This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Usama Jawad96
      Support for end-to-end encryption in Microsoft Teams calls is now in public preview
      by Usama Jawad

      Back in June, we learned that Microsoft has begun testing support for end-to-end encryption (E2EE) in its online collaboration app, Teams. Although chat data is encrypted both in rest and transit, meetings were not encrypted end-to-end. Today, Microsoft has announced that a public preview of E2EE in Teams calls is now available for organizations to utilize.

      Since this is a preview, there are a few caveats to be aware of. As of now, E2EE is only supported in unscheduled one-to-one Teams calls, and is not available for groups calls and meetings. Of course, both participants of the call will need to enable E2EE on their respective devices for this process to take place. If E2EE is enabled, several other features will become unavailable such as recording, live captions and transcription, call transfer, Call Park, Call Merge, Call Companion, and the possibility to add more participants to the call. The capability is not available for PSTN calls either.

      If a call is end-to-end encrypted, a shield with a lock icon will appear in the Teams window. A 20-digit security code will be also be shown and both parties can verify that the same code is visible to them. Once a call has E2EE enabled, no other party, including Microsoft, will have access to the decrypted content. Furthermore, your preferences for E2EE will carry across devices as long as you have the latest desktop client installed on Windows and Mac, or if you're running the latest version of the Android or iOS app.

      Depending upon customer feedback, Microsoft will explore if E2EE can be rolled out for group calls at a later, unspecified date. Groups calls and chat currently utilize a pattern called "Microsoft encryption". If you're an IT admin or a commercial user of Teams, you can head over to the blog post here to find out details about the E2EE methodology and how to enable it across your entire organization.

    • By Usama Jawad96
      A new Feedback portal for Windows, Teams, and Microsoft Edge is coming later this year
      by Usama Jawad

      Microsoft already offers a bunch of different channels for customers to file feedback regarding its products. Among these is the Feedback Hub launched in 2016 as well as dedicated mechanisms to do the same in individual apps, like Microsoft Edge. The company also shut down UserVoice forums earlier this year, which previously offered another way to voice your concerns to the company. Of course, how much importance the company gives to your feedback is another story altogether. Now, news has emerged that the Redmond tech giant is readying another feedback portal, which will be available in preview later this year.

      Feedback Hub in Windows 10 This information comes from Carl Knecht on Twitter, who posted a screenshot of an announcement made by Microsoft in the Admin Center, indicating that the company is preparing a new "Feedback portal" for Microsoft 365, Teams, and Edge. This will be available in preview later this year, with other products, such as Windows, being added next year.

      The upcoming Feedback portal is presumably a replacement for UserVoice forums, and will enable customers to submit feedback, comment on and upvote feedback posted by others, and receive status updates and responses from Microsoft. The Redmond tech giant says that the mechanism is powered by Dynamics 365 Customer Service.

      While Microsoft hasn't provided an exact date for the launch of this new Feedback portal, it is scheduled to become available globally later this year, but only in the English language; other languages and products will be added later. Organizations can still choose to provide feedback from the existing dedicated mechanisms within individual apps and disable this new Feedback portal company-wide altogether.

    • By Usama Jawad96
      Closer Look: Microsoft Teams integration in Windows 11
      by Usama Jawad

      Windows 11's general release is roughly 10 days away, and while it will not be available to everyone on October 5 due to a staggered rollout strategy, if you're eager to upgrade to the OS as soon as possible, you're also likely interested in what it has to offer. This is exactly what we have been covering in our ongoing Closer Look series over the past few weeks.

      So far, we have taken a look at Search, Widgets, the Start menu, Snap Layouts and Snap Groups, the Taskbar, quick settings and notifications, Virtual Desktops, power and battery settings, default apps configurations, File Explorer, and context menus in Windows 11. Today, we'll be taking a look at the deeper integration of Microsoft Teams with Windows 11. While we did discuss it before, that was from a hands-on perspective two months ago, so it's worth discussing it in terms of features and an overall end-user experience.

      Unlike previous Closer Look articles where we compared the upcoming OS' capabilities with its predecessor, we'll only be discussing Microsoft Teams' integration with Windows 11 this time. This is because Teams is offered as a standalone app in Windows 10 and isn't installed by default. Windows 11 does not install Skype automatically either. So the two implementations are fairly independent.

      For the purpose of this hands-on, we'll be taking a look at Windows 11 build 22000.194 that was released to the Beta Channel a few days ago. As usual, it is important to note that the OS is still under active development so it's possible that some of the features we talk about may change by the time of Windows 11's general availability.

      Microsoft has included Teams by default in Windows 11 and has promised deeper integration with the OS. When you boot up the OS for the first time, you'll notice a purple chat bubble icon on your taskbar, representing the capability. If you hover over the icon, you'll notice that it is actually referred to as "Chat", the same branding is present in the Windows Settings app too.

      When you click on it to launch it, you will be asked to sign up. The only sign-up method that Microsoft allows right now is with a personal account. If you want to sign in with a work or school account, you have a button at your disposal that will direct you to download the "full" Teams app. As is evident from the "Meet and chat with friends and family" tagline when you launch the app for the first time, Microsoft seems to be positioning this as an online chat app for personal use rather than a hybrid one which combines personal use with work or education as well. I'm not sure if the company plans to expand this offering or maybe have different Teams versions for different SKUs of the OS, but this is at least how it is on Windows 11 Home's Beta channel right now. Provided that you do have an eligible personal account, the sign-in process is fairly straightforward. You'll get the option to sync your contacts from Outlook and Skype, and you'll be up and running in a matter of seconds.

      Once you sign-in, you'll first be shown the "full" Teams experience, which is labeled as a "Preview" right now. If you've used the standalone Teams app before, you'll notice a very familiar UI. The chats and contacts are on the left side, with some options like Activity, Chat, and Calendar on the left. You can access settings from the ellipsis menu on the top-right, and it will show you some basic configurations related to auto-start, notifications, appearance, and privacy. Of course, the regular Teams capabilities such as chatting, groups, and Meet Now are also advertised on launch. You can also be notified about interactions via Windows notifications and reply to messages inline, and although Microsoft makes a big fuss about it in its blog post, I think it's a pretty basic feature and I would have been extremely surprised if it wasn't there.

      Although Microsoft has talked about how it is shifting Teams' architecture away from Electron and AngularJS to Edge Webview2 and React, which will result in lower memory consumption, "work life scenarios, release predictability, and scale up for the client", I personally have not noticed any significant change in terms of how this translates to actual usage yet. This statement is based only on real-world use, which I think that matters more than benchmarks. I'm tempted to say that the launch experience seems slightly faster but once the app is loaded, performance seems very similar to the standalone app to me right now.

      All the capabilities that we have talked about so far are available in the standalone Teams app too. So what deeper integration is Microsoft boasting about? Turns out that clicking on the Teams icon in the taskbar opens up a flyout UI through which you can quickly open pop-up chats, see your recent activity, start Meet Now calls, and search for contacts. If you want to do something else, you can also click on "Open Microsoft Teams" button at the bottom which will open the full Teams app.

      While this is certainly an interesting direction in terms of making Teams a more integrated experience with Windows 11, I'm a bit disappointed with the lack of polish, at least in its current state. I'll go through my grievances one by one.

      While you can open multiple independent pop-up chats, I was quite disappointed to know that there seems to be no support for Snap Layouts and Snap Groups when you hover over the "window" icon. The capability is probably my favorite in Windows 11 and I find it a bit odd that despite being touted as a native integration with the OS, Teams' pop-chats have to be snapped using the Windows + directional keys or by manually dragging the window. Not a good look from a multitasking perspective.

      Secondly, the context menus in the flyout UI are surprisingly lackluster. When I right-click on any of my synced contacts, I get no context menu at all. When I right-click on a recent contact (screenshot above), I only get a couple of options, namely Audio call and Video call. If I want to mute, hide, or delete a chat, I have to open the full Microsoft Teams app.

      It's just odd, really. It actually got me wondering that maybe I'm using an outdated version of the app but when I went to the "About Teams" section, I found out that I was using the most up-to-date version. This seems to be another example of Microsoft's "ship first, fix later" mantra. I fully understand that I'm using a preview version of the OS, but hey, Windows 11's general availability is less than 10 days away, and I find it unlikely that the company will fix this and other issues I have talked about so far before then. If it does, kudos to them and I'll update this piece with a note at the end.

      Remember I talked about having the ability to delete items only via the full Microsoft Teams app? Turns out even that does not work as expected sometimes. I started a "Meet Now" interaction just for testing and then closed it. I keep trying to delete it and mark it as read but to no avail. It still shows up as an "unread" chat with the annoying notification bubble both in the taskbar and inside the Teams app. You can see a screenshot of this instance above.

      I have to emphasize that this is not a widespread issue in the sense that it does not apply to all of my chats, but the fact that it is inexplicably tied to this one chat is a bug that's bugging the hell out of me (pun intended).

      Finally, while it's possible to send a message directly to a phone number (or email account), SMS chat is only available in the U.S., UK, Canada, Mexico, Brazil, Colombia, and India. All recipients in other countries get a notification on their phone number, and are asked to download the Teams app. I know I can't entirely blame Microsoft for this because it's likely related to telecom operators as well, but it's again disappointing to see that an OS that is supposed to rollout globally does not support a mode of communication across more countries. I know we live in an increasingly internet-connected world where SMS as a method of message delivery is dying, but if it's supported in a handful of countries, it should be supported in more too. Maybe Microsoft will add more countries with the passage of time, but that's how it is right now.

      Overall, while I like the Teams flyout UI in Windows 11, the lack of capabilities in it makes me wonder if it's preferable to just download the Teams standalone app rather than relying on the current integration. I don't have anything against the capability but it's just not a big enough selling point for me personally, at least not in its current state.

      It's clear that Microsoft wants to make this the FaceTime for Windows where people use it as a part of their daily personal life, but it's not a unique idea. The company tried and failed at that already with Skype and I don't see a massive value addition right now.

      Personally speaking, I just don't see myself calling and chatting with friends and family from a PC when there are more convenient and feature-rich alternatives like WhatsApp, both on phone and PC. The only possible benefit I can actually see right now is the ability to screen-share while on calls, but that's again something that I do regularly in my work environment, not relatives and friends. Even more importantly, given the lack of cross-messaging support using at least SMS, you'd actually have to get all your contacts to sign up to a Microsoft account in Windows 11 for this to even be a viable mode of communication in your circle. Given how well-adjusted people are to (better) alternatives, I don't see this happening in the near future, at the very least.

      Teams integration with Windows 11 right now is just not in a state for me where I can consider it a part of my daily life. It will undoubtedly improve with time but I'm yet to find out how it will replace my current modes of online communication. Given the lack of a proper use-case and unpolished experience, the only thing I will do right now is to go to Settings and hide the icon from my taskbar (you can't even unpin it directly from the crippled taskbar). While you can uninstall the app from the "Add or remove programs" settings in Windows, it doesn't hide the Chat icon on the taskbar, and if you launch it after removal, it will download the Teams app again and ask you to sign-in. Hiding it from the taskbar is much more convenient.

      All in all, I understand that the Teams integration is currently in preview, it's just not a very good preview right now.

      What do you think of Microsoft Teams' integration in Windows 11 right now? Have you had a pleasant experience so far? Do you see a use-case for it? Let us know in the comments section below!

      Take a look at the section here or select from the links below to continue exploring Windows 11 in our ongoing "Closer Look" series:

      Closer Look: Search in Windows 11 Closer Look: Widgets in Windows 11 Closer Look: Start menu in Windows 11 Closer Look: Snap Layouts and Snap Groups in Windows 11 Closer Look: Taskbar in Windows 11 Closer Look: Quick settings and notifications in Windows 11 Closer Look: Virtual Desktops in Windows 11 Closer Look: Power and battery settings in Windows 11 Closer Look: Default apps settings in Windows 11 Closer Look: File Explorer in Windows 11 Closer Look: Context menus in Windows 11
    • By Usama Jawad96
      VaxApp is Microsoft's Teams app for organizations to manage vaccination attestation
      by Usama Jawad

      Recently, U.S. President Joe Biden announced that the Department of Labor is developing a mandate according to which employers with over 100 employees are required to ensure that their entire workforce is either vaccinated or return negative tests every week. To that end, Microsoft is making it easier for Microsoft 365 organizations that fall in this criteria to manage vaccine attestations by releasing an open-source deployable Teams app.

      The application is called VaxApp and is a product of Power Apps, utilizing Dataverse on the backend. Microsoft has touted it as a medium scalability and low-cost solution that can be further customized according to the needs of an organization.

      The app is built with Dataverse for Teams' 2GB limit in mind so it does not currently support the uploading of scanned vaccination cards as they can consume a lot of storage. Microsoft says that organizations which require this functionality can extend the solution themselves and use the full version of Dataverse instead. The same version has also been suggested for DoD and GCC-High tenants as well as organizations which require more than 2GB of storage.

      VaxApp end-users will be able to submit attestations for themselves or on the behalf of another person, and view their attestation submissions. Meanwhile, admins will be able to export uploaded data for reporting purposes as well. Since this is an open-source application with an MIT License, managing the security and privacy of the solution and complying to government regulations is the responsibility of the organization deploying the solution, not Microsoft. You can view the project and its deployment guide in detail on GitHub here.

    • By davidpaj
      Facebook introduces two additions to the Portal family
      by David Allen

      Today, Facebook announced two new additions to the Portal family of video calling devices. The portable 10-inch version, Portal Go, is priced at $199 while the larger 14-inch version with a tilting HD display, called Portal+, is $349. Pre-orders are open now at portal.facebook.com with devices expected to be available on October 19. Facebook is also pushing its Portal brand into the business market with Portal for Business.

      Portal Go brings the best of Smart Camera video calling to a device that can move from room to room. The new 12-megapixel ultrawide camera, integrated carrying handle and long-lasting battery allow conversations to go anywhere. It also doubles as a portable speaker for your home when not on video calls.

      The all-new 14-inch Portal+ features a 12-megapixel Smart Camera with an ultrawide lens. Stereo speakers are also a bonus on the Portal+. Portal makes the perfect dedicated screen for video calls, freeing your computer for notes and multitasking.

      Portal is not just for work though, with integrations for Spotify, Pandora, and iHeartRadio you can enjoy high fidelity tunes throughout the day. You can also display your favorite photos from Facebook and Instagram and share them with family and friends.

      Beginning in December, Portal takes business collaboration even further by enabling integration with Microsoft teams across all touch-enabled Portal devices. With Microsoft Teams integration users will have files, contacts, calendars, and more right at their fingertips. Teams will have Microsoft security built-in with Microsoft Intune app protection.

      Facebook is also introducing Portal for Business which is a new service for small and medium-sized businesses (SMBs) to leverage Portal’s video calling. SMBs will be able to create and manage Facebook Work accounts. Portal Device Manager will also allow companies to manage employee devices and access the business portal. Portal for Business also allows organizations to provision, reboot, and see the status of devices no matter where your workforce is located. Portal for business is currently in beta if you’d like to learn more or participate go to the Portal for Business website.