Can I display a subset of MS Teams messages? - microsoft-teams

I'd like to somehow tag messages with some kind of identifier and then filter on that identifier when displaying those messages (via MS Graph API or similar). Is this possible with MS Teams?

Related

How to send messages (3 types, text only) from external service to MS Teams user; each type can be toggled ON or OFF by that user in MS Teams?

Im new to MS Teams application development and looking for suitable solution based on the following requirements. Can I have some guidance from experts?
I have a web service, which sends emails to users based on certain activity. Eg: "Survey started", "Reminder for those who didn't complete the survey" and "when the survey results are out". On top of the email notifications, I also want to send a notification to those individuals who opt-in to receive the notification in MS Teams.
My requirements are,
My web service should be able to send the notification to those
opt-in users in MS Teams as a private message and not as a message in
groups/channels.
In MS Teams, the users should have control over which notification
they wants to receive. For eg: "User A" can opt-in to receive a
notification when a survey starts & survey reminders but can opt-out
of survey results notification where as "User B" can opt-in to
receive notifications for all three.
opt-in and opt-out settings for specific notification should be
configurable in the MS Teams. My web service irrespective of the
settings, will always send the notification to MS Teams but it will
be controlled in the MS Teams side whether to show the notification
to the user or not based on the individual user settings.
Based on the above requirements, please advise what should I build in MS Teams. Whether "Tabs" is enough or "Bot" needs to be built or anything else.
Any guidance or suggestions are really appreciated. Thanks in advance.
Please find below suggestions as per your requirements:
You can use the activity feed notification APIs in Microsoft Graph
to extend this functionality or SDK methods:
Reference doc link, Reference sample link
Also you can send proactive notifications via bot to user:
Send proactive messages
You can create a configurable page and add it to your Tab, which
will be visible to all users who install the bot.
There is no way in MS Teams which will filter or control the
notification to send it to different users without any custom
configuration or condition check.

How to find chat conversation with bot

we are working on MS Bot Framework bot. We are integrating with directline and MS teams. In certain cases we need to download conversation history. Within directline we are using standard DL endpoints to retrieve the conversation. However these are not available for teams channel. Therefore we are trying to get chat messages using Graph API by using
/me/chats/{id}/messages
And here's our issue - to get the chat ID we are trying to iterate through chats returned by
/me/chats
And then look up conversation members by
/me/chats/{id}/members
However chat with Bot contains only user and not the bot so it appears it is a single member chat. As workaround we always sort chats by last updated timestamp descending and assuming first single member conversation is the one we are looking for however this is tricky and unreliable and also very slow some times. Is there some better way to get conversation history from MS teams channel?
Using Graph API, you can access information related to channels in Microsoft Teams. You can refer to list channel messages which retrieves the list of messages (without the replies) in a channel of a team. If you want to get the replies for the message, then you need to call list message replies or get message reply API.
GET /teams/{id}/channels/{id}/messages
One more way is to subscribe to the channel using change notifications API which makes you get all the messages of the channel to the notification endpoint.

How I can send a message with action button in it with MS Teams?

I'm using post to webhook for sending message to MS Teams, I need that some messages with button, Is it way to do this rather than CSS or HTML tags?
Webhook support Message card in MS Teams.
You can find the sample json here.
It will produce below card.

Maximum Number of Adaptive Cards on Carousel - Microsoft Teams

In Microsoft Teams, what is the maximum number of adaptive cards that can be stacked on a carousel using Bot Framework? Is there any official docs on this?
I looked in the Bot Framework source code and didn't see anything that seems to limit the number of attachments you can attach to a message. This seems to indicate that any limitations would be based on the channel that's rendering the attachments and not based on the Bot Framework.
The Attachments property is an IList<Attachment>. While Lists have 32-bit integer indexes, you're sure to run out of memory if you try to use int.MaxValue. I tried adding as many attachments as I could and the process seemed to get stuck at iteration number 8,115,461. Limiting it to 1,000,000 attachments, I was able to create the message but hit an exception when I tried to post it. With 100,000 attachments, I could get the message to send in the emulator but couldn't view the message in the inspector. With 10,000 attachments, I could see all of the attachments in the inspector but couldn't send the message in other channels once I published the bot.
In the end it looks like 10 is the maximum number of Adaptive Card attachments you can have in a message sent through Microsoft Teams. Even if this limitation wasn't in place, I'd recommend not putting more than 10 attachments in a carousel anyway. There is some documentation here, but it seems to pertain to email messages and doesn't mention cards.

MS Botframework Directline v3.0 messageIds repeating - how to make them unique?

We have developed Windows Service that sends messages to Directline API 3.0. Besides creating new conversation it uses also reconnect if the conversation was idle until the token expired.
Lately, we observed duplicated message Ids for messages with different content - see an example of 3 such message Ids from one conversation:
EfNI0i891Ic9T0UyK3QbOP|0000001 2017-10-20 08:44:10.133
EfNI0i891Ic9T0UyK3QbOP|0000001 2017-10-23 15:31:20.000
EfNI0i891Ic9T0UyK3QbOP|0000001 2017-10-25 21:33:01.897
It looks like the numbering was reset at random time even that the highest message Id of the whole conversation was
EfNI0i891Ic9T0UyK3QbOP|0000233
Is there some built-in mechanism, 3rd party component or known approach to control creating of message Ids or using "alternative-message-Ids" so that we can make them unique?

Resources