Programmatically Schedule/Create Skype for Business Meeting - c#

I am working on a C#/console application that will schedule Skype for Business meetings and have not been able to find a clear answer on what is possible and what is the correct approach / sdk to use for doing so.
The application needs to:
Create an lync / skype for business meeting at a future date with a single presenter who can bypass the lobby
Retrieve the URL for joining that meeting for use in an email invitation to the other participants (outside the organization)
This would be running against on office 365 instance of Skype for Business. I have found a dizzying amount of information regarding the subject here in various SDKs that may / may not apply:
Lync 2013 SDK
UCMA 4.0 SDK
Skype Web SDK
All seem to indicate they are not compatible with office 365 though, has anyone built a similar application or dealt with this before that could provide some advice?

You can create a meeting using the Skype for Business User API (UCWA), which is now available for Skype for Business Online (Office 365).
Specifically, you need to make a POST request to the "myOnlineMeetings" resource:
POST https://lyncweb.contoso.com/ucwa/oauth/v1/applications/103...740/onlineMeetings/myOnlineMeetings HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer cwt=AAEB...buHc
[...]
{
"attendanceAnnouncementsStatus":"Disabled",
"description":"hey guys let's do a musical!",
"subject":"holiday party",
"attendees":["sip:Chris#contoso.com","sip:Alex#contoso.com"],
"leaders":[]
}
In the response, you'll get a "joinURL" that you can give to participants:
HTTP/1.1 200 OK
[...]
{
"accessLevel":"SameEnterprise",
"entryExitAnnouncement":"Disabled",
"attendees":["sip:Chris#contoso.com","sip:Alex#contoso.com"],
"automaticLeaderAssignment":"Disabled",
"description":"hey guys let's do a musical!",
"expirationTime":"\/Date(136...000)\/",
"leaders":[],
"onlineMeetingId":"DED...367",
"onlineMeetingUri":"sip:Dana#contoso.com;gruu;opaque=app:conf:focus:id:DED...367",
"onlineMeetingRel":"myOnlineMeetings",
"organizerUri":"sip:Dana#contoso.com",
"phoneUserAdmission":"Disabled",
"lobbyBypassForPhoneUsers":"Disabled",
"subject":"holiday party",
"joinUrl":"https://meet.contoso.com/dana/DED...367","56de...4c83":"please pass this in a PUT request",
"_links":{
"self":{"href":"/ucwa/oauth/v1/applications/103...740/onlineMeetings/myOnlineMeetings/DEDX9367"},
"onlineMeetingExtensions":{"href":"/ucwa/oauth/v1/applications/103...740/onlineMeetings/myOnlineMeetings/DED...367/extensions"}
},
"rel":"myOnlineMeeting",
"etag":"891...351"
}
Note that the meeting doesn't have a scheduled time associated with it. It can be used at any time. You can of course place the URL in a calendar appointment (e.g. Outlook does this) but Skype for Business doesn't know about it.
Full details about the "myOnlineMeetings" request are here.

sched.lync.com
You have to rebuild the form request. This is the only way at this time.
We try the communication right now with java.

Related

Fetching user information on Messaging Extension (Microsoft Teams)

I have a messaging extension that will be used with our VoIP system.
Let's say I have a 1:1 conversation with another user. I want my messaging extension to be able to fetch the other user's information (Name, email, AadObjectId, etc). The closest information I get is the Conversation ID of the 1:1 chat with that user. I then tried both the following:
SDK:
List<ChannelAccount> teamMembers = (await turnContext.TurnState.Get<IConnectorClient>().Conversations.GetConversationMembersAsync(turnContext.Activity.Conversation.Id).ConfigureAwait(false)).ToList();
As well as the direct endpoint with the conversation id:
https://smba.trafficmanager.net/amer/v3/conversations/{REDACTEDCONVERSATIONID}/members
Both gave me error 403 (Forbidden) with the message:
"error": {
"code": "BotNotInConversationRoster",
"message": "The bot is not part of the conversation roster."
}
We really need the messaging extension to be able to pull that information out, is there any way we can do so?
I am using the BotFramework SDK, latest version
So as you've discovered, you can't do this the way you're trying to, via the bot directly (i.e. via the 'conversations' endpoints) if the bot is not actually installed into that particular location (1-1 chat, channel, etc.). However, this definitely -is- possible, just via another route. What you need to do is to use Microsoft Graph, in particular the operations to get conversation members. However, in order to do this, you'll need to implement sign in in your Message Extension. Fortunately, there was a discussion on this exact topic in the latest Teams community call from this month. The sample is in node, but the same applies to C# (what I see you're using).

403 Message: Legacy People API has not been used in project [duplicate]

This question already has an answer here:
Legacy People API has not been used in project
(1 answer)
Closed 1 year ago.
Google API is active but give error ;
Legacy People API has not been used in project before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/legacypeople.googleapis.com/overview?project= then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
You don't need to install any other APIs like Google Drive API, Google Sheets API or other except Google+ API,
The error is coming because of "passport-google-oauth": "^1.0.0"
Just change the version "passport-google-oauth": "^1.0.0" to "passport-google-oauth": "^2.0.0" and remove node_modules and package.lock.json file and run "npm i"
That's it
Before the Google+ API Shutdown on March 7, 2019, the people.get and people.getOpenIdConnect methods were available for requesting a person’s profile.
To avoid breaking existing integrations with these methods supporting sign-in, a new minimal implementation only returns basic fields necessary for that functionality, such as name and email address, if authorized by the user. The Legacy People API is where these methods will remain available for existing callers at the existing HTTP endpoints.
The Legacy People API serves a limited new implementation of the legacy Google+ API people.get and people.getOpenIdConnect methods necessary for maintaining sign-in functionality. It is available to existing callers of the original methods that haven't migrated to recommended replacements such as Google Sign-in or Google People API at the time of the Google+ API shutdown.
enter link description here
Thanks
In this case, I'm facing the same issue. This is what I've done to fix it.
Situation:
NodeJS ver 8
"passport-google-oauth": "^1.0.0"
Using Google+ API as Google Sign-in
When I run the apps and click Sign in with Google, what happened then?
Server error
Error log: Legacy People API has not been used in project "xxxx" before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/legacypeople.googleapis.com/overview?project=xxxx then retry.
How I solve it?
Go to Google Console
Click on Google+ API under Social APIs, then click Enable API
Click on Google Drive API under G Suite, then click Enable API
Click on Google Sheets API under G Suite, then click Enable API
Update "passport-google-oauth": "^1.0.0" to "passport-google-oauth": "^2.0.0"
in package.json
remove package-lock.json and node_modules folder (to ensure everything is clear)
run this command : npm install
It works now!
Note: my previous code still using profile._json.image.url to get profile image. Actually, this response was not there anymore. So I delete this code.
Goodbye Google+
Thank you Google People API.
Enabling the Google Contacts API and the Google+ API fixed this issue for me.
Hi I recently stumbeled on the same issue. As explained by Ilan Laloum, Google+ API as been decommissionned completely for new projects.
I found that Google People API works in a similar way. The following example is based on the Bookshelf tutorial in GCP. Source code can be seen here: https://github.com/GoogleCloudPlatform/golang-samples/tree/appengine/go111/cloudsql/getting-started/bookshelf (branch appengine/go111/cloudsql)
import people "google.golang.org/api/people/v1"
...
// retrieves the profile of the user associated with the provided OAuth token
func fetchProfile(ctx context.Context, tok *oauth2.Token) (*people.Person, error) {
peopleService, err := people.NewService(ctx, option.WithTokenSource(bookshelf.OAuthConfig.TokenSource(ctx, tok)))
if err != nil {
return nil, err
}
return peopleService.People.Get("people/me").
PersonFields("names,coverPhotos,emailAddresses").
Do()
}
This method needs a context and a OAuth token, just like Google+ API used to. The peopleService is initialized in a similar fashion.
The peopleService.People.Get("people/me") prepares a query that fetches the profile of the connected user. Then PersonFields("names,coverPhotos,emailAddresses") is a filter on profile fields. This part of the request is mandatory. Eventually Do() will execute the request.
This issue can be fixed using the passport-google-token
npm install passport-google-token
const GoogleStrategy = require('passport-google-token').Strategy;
// Google OAuth Strategy
passport.use('googleToken', new GoogleStrategy({
clientID: CLIENT_ID,
clientSecret: CLIENT_SECRET
}, async (accessToken, refreshToken, profile, done) => {
try {
console.log('creating a new user')
const newUser = new User({
google: {
id: profile.id,
email: profile.emails[0].value
}
});
await newUser.save();
done(null, newUser);
} catch (error) {
done(error, false, error.message);
}
}));
I was also having the same issue but with my Rails app. So I resolved it by upgrading the omniauth gems by running bundle update devise omniauth omniauth-google-oauth2 in terminal.
I also faced the same issue. This issue may occur for using the old library, enable the google people Api for your project, and download the library as per your php version from this link and integrate it.

Unable to create a Team programmatically

I have successfully created Office 365 Group, added members and owners and now I am trying to provision a Team for this group. How am I supposed to provision it using MS Graph in .NET Console App?
I tried the following code but I am not getting my Team.
var team = new Team
{
GuestSettings = new TeamGuestSettings
{
AllowCreateUpdateChannels = false,
AllowDeleteChannels = false
}
};
await graphServiceClient.Groups[groupID].Team.Request().CreateAsync(team);
Response from the above code
Message: No HTTP resource was found that matches the request URI 'https://api.teams.skype.com/v1.0/groups('da87fc59-403b-4b0f-973f-f812d41143aa')/team'.
Inner error
Error Screenshot
Edit: I am using latest NUGET package for MS Graph extensions.
Edit 2: Tried to do following instead.
await graphServiceClient.Groups[groupID].Team.Request().PutAsync(team);
Got this:
Code: UnauthorizedAccess
Message: Failed to execute Aad backend request GetTenantSubscribedSkusRequest. Request Url: https://graph.windows.net/dc7b2a82-XXXX-XXXX-XXXX-46122279d033/subscribedSkus?api-version=1.6, Request Method: GET, Response Status Code: Unauthorized, Response Headers: ocp-aad-diagnostics-server-name: HmmXXX+7Su9HNJVjwqsmVjPsrXXXXXXXX/iNwuI3H74=
request-id: 9257706c-XXXX-XXXX-XXXX-bbf33b98da7d
client-request-id: f263695b-XXXX-XXXX-XXXX-9fdf185fXXXX
Strict-Transport-Security: max-age=31536000; includeSubDomains
Date: Wed, 19 Jun 2019 13:20:18 GMT
Any suggestions?
Microsoft document says
If the group was created less than 15 minutes ago, it's possible for
the Create team call to fail with a 404 error code due to replication
delays. The recommended pattern is to retry the Create team call three
times, with a 10 second delay between calls.
I faced this issue and after the retry logic as suggested above it works fine all the time
Make sure you are using a Delegated authentication context (a user must be signed in) with the permission Group.ReadWrite.All
Make sure you have consented to the application permissions (from the API permissions screen of the application registration, you'll find a Grant Consent button all the way down)
Use the PutAsync method (today, as you mentioned, you must create the Office 365 group first and then enable Teams)
Can you confirm that the group actually gets created? "No HTTP resource was found that matches the request URI" often means that the graphServiceClient.Groups[groupID] doesn't work. Which is likely around permissions.
I noticed I have the same problem with application permissions. The one thing I have found that will unblock the code to work again is to create a team through the Graph Explorer and then I am good for a couple days.
Then the error comes back again and I create another team through the explorer and I can start creating like before. This tells me it is not a code problem but an issue on the Teams graph connection somewhere.
It was a service bug. Works now.
Link to service bug on GitHub

TFS 2015 Web Hook to Slack Integration

I have got a requirement,
When a work item is created (and status -say In progress) in TFS 2015(not vsts), I want my web hook to fire a post method which ll create a Channel in Slack, and invite few folks.
2) Once the Bug is closed - read all the history of channel and push the history back to Bug.
I was able to achieve the same with TFS server side plugin and it's working, but requirement got changed to Web hooks.
Could someone help me on how to achieve custom web hook.which ll enable events from TFS WI to Slack please?
Thanks,
You can not create new incoming webhooks in slack programmatically, but you can use any existing incoming webhook for a new channel.
Just add the channel property in your message to the webhook.
Example from the Slack documentation:
curl -X POST \
--data-urlencode 'payload={"text": "This is posted to #general and comes from *monkey-bot*.", "channel": "#general", "link_names": 1, "username": "monkey-bot", "icon_emoji": ":monkey_face:"}' \
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
So to implement your requirement I suggest you create a new channel and invite users as needed through the Slack web API. And then use an existing incoming webhook to send messages to that channel.
TFS has default slack service hook which can post a message to a channel. The API looks like below:
POST http://tfsserver:8080/tfs/DefaultCollection/_apis/hooks/subscriptions?api-version=3.2
Content-Type: application/json
{
"consumerActionId":"postMessageToChannel",
"consumerId":"slack",
"consumerInputs":{
"url":"https://hooks.slack.com/services/xxxxxx"},
"eventType":"workitem.created",
"publisherId":"tfs",
"publisherInputs":{
"areaPath":"",
"workItemType":"",
"projectId":"77e3c775-dc30-4354-xxxx-xxxxxxxxxxxx"}
}
For your second requirement, you need to check Slack Api to see how to read all the history of channel, and use Update work items to update Bug work items.

What are the available functions to send notifications to a Facebook user?

Currently I am using Codeplex's Facebook Developer Toolkit version 2 for my ASP.net Facebook application. I would like to be able to send notifications to a user's Inbox or wall of the application and was wondering what are the available functions to do that? If not in the API, then please provide example functions from the main Facebook library. This will help immensely. Thanks!
After a brief search I found an example of sending notifications using the toolkit:
facebook.Components.FacebookService fs
= new facebook.Components.FacebookService();
fs.ApplicationKey =
ConfigurationManager.AppSettings["APIKey"];
fs.Secret =
ConfigurationManager.AppSettings["Secret"];
string sessionKey =
dict["facebook_session_key"];
fs.SessionKey = sessionKey; fs.uid =
long.Parse(member.FacebookId);
fs.notifications.send(member.FacebookId,
"notification message");
(from: http://facebooktoolkit.codeplex.com/Thread/View.aspx?ThreadId=49876)
After looking through the Codeplex source it's clear that this sends a user-to-user notification, and therefore requires an active user session of the sender.
Codeplex does not appear to support app-to-user notifications which do not require a session, but adding this feature would be trivial. Add a type variable to the send method and set it accordingly based on the API documentation here: http://wiki.developers.facebook.com/index.php/Notifications.send
The source code for the notifications.send method in the Codeplex Developer Toolkit is here:
http://facebooktoolkit.codeplex.com/SourceControl/changeset/view/28656#233852
Please keep in mind that the Codeplex developer toolkit source code has not been updated in over 3 months. This means that it does not support many new Facebook API features and changes. You may want to browse the client library wiki page to find a library that is more up to date: http://wiki.developers.facebook.com/index.php/Client_Libraries

Categories