Bridge Communications

Saturday, March 18, 2017

Skype for Business Trusted Application API - Part III

Over the last 2 blog posts I have outlined how to create the Azure AD, and SFB prerequisites to create a TAP Application.  This week we will use those settings to create a simple test application.  We will base it on the sample code example called Remote Advisor (spelled wrong) here.

Before we begin making changes let's make sure you have the latest nuget packages, and the prerelease option turned on.  As of today pre-release v4 is the current version.

We will begin by opening the sample code and looking at the App.config file.

Here we will need to fill out 3 things;

1.  AAD_ClientId - This is your application ID found in the Azure AD portal.
2.  AAD_ClientSecret - This is the client secret which was created and visible right after creating the app.  If you lost it, you can make a new one in AAD under keys.
3.  ApplicationEndPointID - This is the endpoint you created in the SFB online powershell last week.

Once you have those updated go ahead and save the file.  Now we will open the program.cs.

Things you will need to update here are pretty simple to find.

Go to line 60, and change the allowed urls to include your own.  Now build and run the sample.  You should see various lines of output to indicate if the program worked, or an exception detailing why it didn't

A working program should show you tokens along the way as well as your meeting uri like this;

There you have it, you have successfully created a program that has authenticated using the TAP api, and created a meeting.

Doug Routledge, C# Lync, Skype for Business, SQL, Exchange, UC, 
Full Stack Developer  BridgeOC Bridge Operator Console
Twitter - @droutledge @ndbridge