MS Teams - automatic addin integration - microsoft-teams

I built a MS Teams Add-In. If I create a new meeting, I have to add the Add-In every time manually to this meeting.
Is there any way to integrate it to every (new) meeting by default?
Thank you!

Currently there is no way to integrate automatic addin in meeting. Alternatively you can create an event as online meeting using Graph API with below request.
POST https://graph.microsoft.com/v1.0/me/events
Prefer: outlook.timezone="Pacific Standard Time"
Content-type: application/json
{
"subject": "Let's go for lunch",
"body": {
"contentType": "HTML",
"content": "Does noon work for you?"
},
"start": {
"dateTime": "2017-04-15T12:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2017-04-15T14:00:00",
"timeZone": "Pacific Standard Time"
},
"location":{
"displayName":"Harry's Bar"
},
"attendees": [
{
"emailAddress": {
"address":"samanthab#contoso.onmicrosoft.com",
"name": "Samantha Booth"
},
"type": "required"
}
],
"allowNewTimeProposals": true,
"isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness"
}
Please go through this documentation for more info.

Related

teams - graph api - can't create event with defined organizer / specify channel

I'm trying to create an event for a teams. Using the WEB interface, I can create and specify the channel. through the API, there's no channel field.
Also, When I'm specifying an organizer, it's being over writed to some other values.
What I need to do:
1-) create the event and keep the specified organizer
2-) invite all members of the channel (or specify the channel) when creating the event.
I'm following the official 1.0 API:
POST https://graph.microsoft.com/v1.0/groups/{my-id}/calendar/events
{
"subject": "TESTE - New Event - Sala virtual",
"body": {
"contentType": "HTML",
"content": "Does late morning work for you?"
},
"start": {
"dateTime": "2020-04-21T11:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2020-04-21T12:30:00",
"timeZone": "Pacific Standard Time"
},
"location":{
"displayName":"Online"
},
"attendees": [
{
"emailAddress": {
"address":"test#another.com",
"name": "Test"
},
"type": "required"
}
,
{
"emailAddress": {
"name": "Teste",
"address": "group#test.com"
},
"type": "required"
}
],
"onlineMeetingProvider":"teamsForBusiness",
"isOnlineMeeting": true,
"organizer":{
"emailAddress":{
"name":"Owner",
"address":"owner#test.com"
}
}
}

Outlook/Office365 API - Get Calendar events with Extensions

I am using the Office365 API for calendar events. I am able to create an event successfully with Extensions (custom data) like below...
But, when I get calendar events it does not return back any Extensions data field.
GET https://outlook.office.com/api/v2.0/me/events
How do I get the Extensions back in the events data?
POST: https://outlook.office.com/api/v2.0/me/events
authorization: bearer {token}
content-type: application/json
{
"Subject": "Discuss the Calendar REST API",
"Body": {
"ContentType": "HTML",
"Content": "I think it will meet our requirements!"
},
"Start": {
"DateTime": "2016-09-06T18:00:00",
"TimeZone": "Pacific Standard Time"
},
"End": {
"DateTime": "2016-09-06T18:00:00",
"TimeZone": "Pacific Standard Time"
},
"Extensions": [
{
"#odata.type": "Microsoft.OutlookServices.OpenTypeExtension",
"ExtensionName": "Com.Contoso.Referral",
"CompanyName": "Wingtip Toys",
"ExpirationDate": "2015-12-30T11:00:00.000Z",
"DealValue": 10000,
"TopModels": [
3001,
4002,
5003
],
"TopSalespersons": [
"Dana Swope",
"Fanny Downs",
"Randi Welch"
]
}]
}
You could get extension using the below api:
GET https://outlook.office.com/api/v2.0/me/events('{event_id}')/extensions('{extensionId}')
For example:
GET https://outlook.office.com/api/v2.0/me/messages('AAMkAGE1M2IyNGNmLTI5MTktNDUyZi1iOTVl===')/extensions('Com.Contoso.Referral')
For more information, please refer to the below link:
Get extension

Why are my chatbot refresh cards in Teams not refreshing?

I am serving out O365 connector cards to my teams channel in my chatbot, for the user to use an HttpPost action to send data back to the bot.
Here is a sample invoke message when the user saves:
{
"name": "actionableMessage/executeAction",
"type": "invoke",
"timestamp": "2018-06-16T20:58:24.388Z",
"localTimestamp": "2018-06-16T21:58:24.388+01:00",
"id": "snip",
"channelId": "msteams",
"serviceUrl": "https://smba.trafficmanager.net/emea-client-ss.msg/",
"from": {
"id": "snip",
"name": "my name",
"aadObjectId": "snip"
},
"conversation": {
"conversationType": "personal",
"id": "long conversation id"
},
"recipient": {
"id": "bot id",
"name": "bot name"
},
"entities": [
{
"locale": "en-US",
"country": "US",
"platform": "Web",
"type": "clientInfo"
}
],
"channelData": {
"tenant": {
"id": "tenant id"
},
"source": {
"name": "message"
}
},
"replyToId": "message id",
"value": {
"body": "{\"sportType\":\"1\", \"tournamentName\":\"FIFA Soccer World Cup\",\"startTime\":\"2018-06-14T03: 00: 00.000Z\", \"endTime\":\"2018-07-16T07: 30: 00.000Z\", \"timeZone\":\"Russian Standard Time\", \"tournamentId\": \"1\"}",
"actionId": "SaveTournament"
}
}
In response to a save card, I am returning an ActionCard in the response body, and I am including an HTTP header "CARD-UPDATE-IN-BODY" with a value "true". Here is a sample response message:
{
"#type": "ActionCard",
"inputs": [
{
"#type": "TextInput",
"isMultiline": true,
"maxLength": 500.0,
"id": "SaveStatus",
"isRequired": false,
"title": "Save Status",
"value": "You updated the tournament FIFA Soccer World Cup running from 6/14/2018 to 7/16/2018 in timezone Russian Standard Time"
}
],
"actions": [
{
"#type": "HttpPOST",
"body": "{\"tournamentId\": \"1\"}",
"name": "Update FIFA Soccer World Cup again",
"#id": "UpdateTournament#1"
}
],
"name": "Save Tournament",
"#id": "SaveTournament"
}
I have traced this in my web app so I know that is what is being returned to the bot framework middleware.
In my teams app in the browser,when I trace the response message with Fiddler, the card invoke response is not getting the refresh card I send, it is just getting a generic 200 response with an empty response body. Can anyone point me to a demo of refresh cards that work with Teams, or tell me what's wrong with my messages?
Teams doesn't support updating the original card by responding to the invoke message. Instead, you need to explicitly update the message by calling the Bot Framework API (see https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/bots/bot-conversations/bots-conversations#updating-messages).
The incoming invoke message has the information you need to update the original message:
<serviceurl>/v3/conversations/<conversationid>/activities/<activityid>
<serviceurl>: serviceUrl
<conversationid>: conversation.id
<activityid>: replyToId
(The details of how to update a message depends on exactly which SDK you're using, but in the end you'll need those 3 items to refer to the message.)

How to create meeting using RubyOutlook gem?

I am new here using ruby and outlook and found the gem RubyOutlook which is wrapper around office365 and ruby
How do i create a meeting request using RubyOutlook gem and do we have any help file for doing it
The gem's readme is scarce, so you have to look in the source code.
After creating an oauth token, as described in the readme, you need to call create_event with the token, event json payload, calendar folder (nil for default calendar) and the email of the user who would be the owner of the event:
require 'ruby_outlook'
outlook_client = RubyOutlook::Client.new
# ...
# create oauth token, as described in the readme
# ...
event_payload =
{
"Subject": "Discuss the Calendar REST API",
"Body": {
"ContentType": "HTML",
"Content": "I think it will meet our requirements!"
},
"Start": {
"DateTime": "2014-02-02T18:00:00",
"TimeZone": "Pacific Standard Time"
},
"End": {
"DateTime": "2014-02-02T19:00:00",
"TimeZone": "Pacific Standard Time"
},
"Attendees": [
{
"EmailAddress": {
"Address": "john#example.com",
"Name": "John Doe"
},
"Type": "Required"
}
]
}
outlook_client.create_event(token, event_payload, nil, 'john#example.com')
Here's the relevant Outlook API documentation for creating events. This is where I took the event payload.

custom field in calendar entry office365

We have an office365 setup and use the mail and calendar API to ingrate with our enviremenet.
Is it possible to add a custom field to calendar entry and be able to access and update via the calendar API?
We can use the data extension API to store custom data in a message, event, or contact of the user's account.
Here is an example that to create extension when create an appointment:
POST: https://outlook.office.com/api/v2.0/me/events
authorization: bearer {token}
content-type: application/json
{
"Subject": "Discuss the Calendar REST API",
"Body": {
"ContentType": "HTML",
"Content": "I think it will meet our requirements!"
},
"Start": {
"DateTime": "2016-09-06T18:00:00",
"TimeZone": "Pacific Standard Time"
},
"End": {
"DateTime": "2016-09-06T18:00:00",
"TimeZone": "Pacific Standard Time"
},
"Extensions": [
{
"#odata.type": "Microsoft.OutlookServices.OpenTypeExtension",
"ExtensionName": "Com.Contoso.Referral",
"CompanyName": "Wingtip Toys",
"ExpirationDate": "2015-12-30T11:00:00.000Z",
"DealValue": 10000,
"TopModels": [
3001,
4002,
5003
],
"TopSalespersons": [
"Dana Swope",
"Fanny Downs",
"Randi Welch"
]
}]
}
Get the extension on a exist object:
GET https://outlook.office.com/api/v2.0/me/events/{eventId}/extensions('{extensionId}')
GET https://outlook.office.com/api/v2.0/me/events/{eventId}/extensions('Microsoft.OutlookServices.OpenTypeExtension.Com.Contoso.Referral')
More detail about this API, you can refer here.

Resources