Saved searches

Use saved searches to filter your results more quickly

Cancel Create saved search Sign up Reseting focus

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

This repository has been archived by the owner on Mar 7, 2019. It is now read-only.

kenakamu / UCWA2.0-CS Public archive

C# library for UCWA 2.0

License

Notifications You must be signed in to change notification settings

kenakamu/UCWA2.0-CS

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Go to file

Folders and files

Last commit message Last commit date

Latest commit

History

View all files

Repository files navigation

C# library for UCWA 2.0

This is a sample library for C# developer to consume UCWA 2.0 (Unified Communication Web API) of Office 365 Skype Service. For more detail about the Web API, please refer to Skype Developer Site (https://ucwa.skype.com) The library is PCL so you can include it in any platform such as UWP, Console, Xamarin, etc. All methods are marked as async and all events are exposed as event so that you can subscribe to handle them. See test client for more detail.

HOW TO TRY

  1. Register your application in your Azure AD tenant.
  2. Login to https://manage.windowsazure.com.
  3. Select "Active Directory"
  4. Select your directory, and go to "APPLICATIONS" tab.
  5. Click "ADD" button on the bottom.
  6. Enter any name, and select "NATIVE CLIENT APPLICATION".
  7. Enter any REDIRECT URI. It is not used in this sample but you can specify any valid URI.
  8. Once application created, select CONFIGURE tab.
  9. Copy "CLIENT ID" for step 2.
  10. Scroll down the page and click "Add application".
  11. Select "Skype for Business Online" and click "OK" (check mark)
  12. Select Delegated Permissions as you need.
  13. Click "SAVE" button to save it.
  14. Open TokenService.cs file under TestClient or UCWAUWP project and update the values.
  15. Compile all solution.
  16. Run TestClient project and try it.

AUTHENTICATION

The wrapper contains all UCWA related class, enums and methods. However authentication is out of scope as each platform may use slightly different method. To authenticate user, use Active Directory Authentication Library (ADAL).

BASICS

1. Add using to your code.

using Microsoft.Skype.UCWA; using Microsoft.Skype.UCWA.Enums; using Microsoft.Skype.UCWA.Models;

2. Instantiate UCWAClient.

UCWAClient client = new UCWAClient();

3. Subscribe SendingRequest to authenticate. You can also subscribe any other events as you need.

// Write some code to obtain accesstoken. You can use ADAL. client.SendingRequest += (client, resource) =>  client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accesstoken); >; // For example, handle message received event. client.MessageReceived += Client_MessageReceived;

4. Instantiate and SignIn.

await client.Initialize(""); await client.SignIn(availability:Availability.Online, supportMessage:true, supportAudio:false, supportPlainText:true, supportHtmlFormat:false, phoneNumber:"", keepAlive:true);

5. Do anything you need.