Microsoft Teams Connector (Questions) - microsoft-teams

I'm trying to figure out the concept of the MS Teams Connectors.
I've created an Incoming Webhook and a ticketing system is sending notifications in the form of "MessageCard" to a specific channel - so far, so good.
If I want to add buttons to this MessageCard, so if an user want to close a specific ticket, how the authentication to the ticket system can be handled?
I've checked and saw that there are "Connectors" for a lot of products. For example there is "Wunderlist" Connector. Once you configure it, it asks for a login and once you actually log-in - you get a list of task and blabla .. etc.
I created a connector, configured manifest.json, sideloaded it in MS Teams and so on .. but in the end I didn't see where exactly I can develop/configure the "login part".
Any help is appreciated!
Here is a screenshot from my demo connector:
While here is a screenshot from Wunderlist Connector:

Check out the sample connector here: https://github.com/OfficeDev/msteams-connector-github. That may be enough to get you going.

Related

Can I create a configuration page for a Teams bot app?

I'm building my first Teams app which will have two primary functions:
Proactively send a message to the channel (the bot is installed into) when a specific event occurs on my backend.
Members of the channel reacts to the message via actions.
I finally have a pretty good idea of how to set this up (I think) - but one part I'm missing is that in order to identify the specific app installation as belonging to one of my customers, I need to be able to allow the installing user to supply extra information like e.g. an API-key so that I can associate the specific channel with my specific customer.
Is there any way of doing this with a bot app? I've found examples for creating a configuration page, but they all seem to be associated with tab apps?
I could of cource have the bot ask the user for the information - but maybe there's a "cleaner" way?
Any examples or tutorials would be greatly appreciated as I find it rather hard to get stuff working using Microsoft's own examples etc. :)
Thanks a lot!
When you receive any message from the user, either by typing to your bot, or even installing it into a channel, group chat, or personal context (where you get the conversationUpdate event), you are able to get specific details off of the activity object. If the user sends a message, for instance, then the text property on the activity object will have a value. Incidentally, this is the same activity you will use to get the conversation details you need for the Proactive message.
With regards your question, the activity class also includes a tenantId property, hanging off the conversation property. This is the unique Microsoft 365 Id for the tenant, which would be what I'd suggest to uniquely identify them for your API, or licensing, or similar.

MS Teams Incoming Webhook issue

I've created an incoming Teams Webhook connector within a Teams group (using the method below).
I can successfully curl to the webhook internally and get the message to display ok.
MS have checked my tenant and access is as expected.
When I apply my URL for the webhook to any external service they eventually come back stating there was a problem detected with the webhook (Please make sure that your webhook endpoint of xxx is responding with a 2xx response code within 30 seconds of initial connection.)
Can anyone advise what else may need to be done?
Thanks
In Microsoft Teams, choose More options (⋯) next to the channel name and then choose Connectors.
Scroll through the list of Connectors to Incoming Webhook, and choose Add.
Enter a name for the webhook, upload an image to associate with data from the webhook, and choose Create.
Copy the webhook to the clipboard and save it. You'll need the webhook URL for sending information to Microsoft Teams.
Choose Done.
Incoming webhooks are special type of Connector in Teams that provide a simple way for an external app to share content in team channels and are often used as tracking and notification tools. Teams provides a unique URL to which you send a JSON payload with the message that you want to POST, typically in a card format. Cards are user-interface (UI) containers that contain content and actions related to a single topic and are a way to present message data in a consistent way. Please test the incoming webhook url using postman and let us know the payload result or status code. Would be help full for us to understand more.

Is there a way to programmatically access the "out of office" status area in Teams group chat views?

Teams appears to have a feature to display miscellaneous messaging in group chat views, just above the conversation message box. I have noticed this when unable to connect to a chat thread, as well as when a member of the group is out of the office and may not respond.
Is is possible to access this programmatically and add our own messages? We're hoping to add retention information for given chat threads and this would be the perfect location to do so. Unfortunately, I've been unable to locate information on this in the SDK docs or elsewhere online.
Currently this is not supported. Could you please Raise a user voice?

Microsoft Teams go to a conversation using a deeplink

we have an app for MS Teams which users can start a conversation and send messages to. The app does some processing and returns the response back. I am looking for the ability to open an precreated conversation using a link. I have needed information like conversation id etc. How do i create a link that can be used for this navigation?
To be more specific this doc is not helpful https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/build-and-test/deep-links#deep-linking-to-a-chat
The link i need is for the conversation. Currently it is possible to manually copy that link by right clicking on any conversation and use "Copy link". Is there a way to get it or generate it when user creates the conversation. A sample link copied from looks like below
https://teams.microsoft.com/l/message/19:a0a0088174a644cb91409f4d8f79d888#thread.tacv2/1612324568748?tenantId=04e930f3-0866-4a6d-b07c-a4737e8f9865&groupId=087bf290-deb5-4790-b159-bf86914765b4&parentMessageId=1612324568748&teamName=Sales%20Team&channelName=FlashCX%20Sales&createdTime=1612324568748
So trying to see if i can either get this the URL using apis or can generate with the parts involved
#Moblize - Currently you can create Deep-link to chat for particular conversation. You cannot create a link which will redirect to a particular message in channel. Please check this docs for info.

How to update an existing activity in WebChat

My scenario is: I send card attachments each with an AcceptButton to users. When 1 user clicks on that button, ideally I want to disable all similar buttons (of the same offer) for all users. I am storing conversation details of each user, and I know the ActivityId of each message-with-said-button (it follows a certain string format).
My issue is similar to this and this but for WebChat not Teams.
I did try those solutions but I got the error "Method not allowed" for both UpdateActivityAsync() and DeleteActivityAsync(). Then I read here that UpdateActivity is not supported in WebChat. (But might be available in the future?)
I would like any visual indication that the offer is no longer available. (Right now, they receive an "Offer was already accepted by {UserX}" which would still be in place on top of changing the card/message.)
Is there a way to do this via backChannel? I can trigger an event and pass the ActivityId (tested by showing a simple alert()) but how do I apply changes to that specific activity?
Per this comment in Web Chat's source code and this open issue in the Web Chat repository for adding support for deleteActivity and updateActivity, Update Activity events are not currently supported in Web Chat. Unfortunately, there is currently no way to really update an activity in Web Chat.
Hope this helps!

Resources