Teams.ThirdPartyAppApi 1.0.3

dotnet add package Teams.ThirdPartyAppApi --version 1.0.3
NuGet\Install-Package Teams.ThirdPartyAppApi -Version 1.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Teams.ThirdPartyAppApi" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Teams.ThirdPartyAppApi --version 1.0.3
#r "nuget: Teams.ThirdPartyAppApi, 1.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Teams.ThirdPartyAppApi as a Cake Addin
#addin nuget:?package=Teams.ThirdPartyAppApi&version=1.0.3

// Install Teams.ThirdPartyAppApi as a Cake Tool
#tool nuget:?package=Teams.ThirdPartyAppApi&version=1.0.3

Third-party app API Client

main NuGet Version

Use this Package to communicate with the Microsoft Teams Third-party app API

Clients

There are two clients available in this package:

  • TeamsClient - for interacting with the legacy Teams app
  • NewTeamsClient - for interacting with the new Teams app

TeamsClient

This client is used to interact with the legacy Teams app. It is used to send and receive messages from the Teams app.

usage
//TeamsClient(string url, string token = "", bool autoReconnect = false, CancellationToken cancellationToken = default)
new TeamsClient("127.0.01", "token from app", true, cts)

NewTeamsClient

This client is used to interact with the new Teams app. It is used to send and receive messages from the Teams app. New Teams only accepts connetcion from localhost so this must run on the same computer as teams. But you can use a socket proxy to use it remotly

This client do not require a initial token. But teams will return a token for future use. To save that token you must subscribe to NewTeamsClient.TokenChanged

//NewTeamsClient(string url, string manufacturer, string device, string app, string appVersion, bool autoReconnect = true, CancellationToken cancellationToken = default)
var client = new NewTeamsClient("127.0.0.1", "companyName", "company device", "teams integgrator", "1.0", true, cts)
client.
    TokenChanged
    .Subscribe(token => SaveToken)
usage
//NewTeamsClient(string url, string manufacturer, string device, string app, string appVersion, bool autoReconnect = true, CancellationToken cancellationToken = default)
new NewTeamsClient("127.0.0.1", "companyName", "company device", "teams integgrator", "1.0", true, cts)

Activate third party app api

old teams

Go to settings → privacy and scroll down to third party api and manage. Then activate it and copy the token.

New teams

go to setttings → privacy scroll to third party api and manage. Activate and go to a meeting. When in a meeting, send a command to teams. A permission popup will appear, press approve.

Reactive

This library uses Reactive dotnet https://github.com/dotnet/reactive. Every change in the client is pushed to the client as an observable. The client can then subscribe to the observable to get the changes.

Example

 _teamsClient.IsConnectedChanged
    .SubscribeAsync(async (connected) =>
    {
        if (connected)
        {
            await WhenConnected();
        }
        else
        {
            await WhenDisconnected();
        }

    });

Demo app

There is a demo app in the solution that shows how to use the clients. The demo app is a console app that connects to the Teams app and sends and receives messages.

Contribute

If you want to contribute to this project, please create a pull request. We will review the pull request and merge it if it is a good fit for the project.

Bugs and feature requests

If you find a bug or have a feature request, please create an issue in the issue tracker. We will review the issue and try to fix it as soon as possible.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.3 97 2/7/2024
0.8.19 79 2/6/2024
0.8.18 82 2/6/2024
0.8.17 78 2/6/2024
0.8.16 77 2/5/2024
0.8.14 73 2/4/2024
0.8.13 72 2/4/2024
0.8.0.10 74 2/4/2024
0.8.0.3 82 2/4/2024
0.8.0.2 76 2/4/2024