Language

TeamsQuerySettingUrlRouteAttribute Class

Definition

Attribute to define a route that handles Teams message extension query URL setting events.

[Microsoft.Agents.Builder.App.RouteHandlerType(typeof(Microsoft.Agents.Extensions.MSTeams.MessageExtensions.QuerySettingUrlHandler))]
[System.AttributeUsage(System.AttributeTargets.Method, Inherited=true)]
public class TeamsQuerySettingUrlRouteAttribute : Attribute, Microsoft.Agents.Builder.App.IRouteAttribute
[<Microsoft.Agents.Builder.App.RouteHandlerType(typeof(Microsoft.Agents.Extensions.MSTeams.MessageExtensions.QuerySettingUrlHandler))>]
[<System.AttributeUsage(System.AttributeTargets.Method, Inherited=true)>]
type TeamsQuerySettingUrlRouteAttribute = class
    inherit Attribute
    interface IRouteAttribute
Public Class TeamsQuerySettingUrlRouteAttribute
Inherits Attribute
Implements IRouteAttribute
Inheritance
TeamsQuerySettingUrlRouteAttribute
Attributes
Implements

Remarks

Decorate a method with this attribute to register it as a handler for message extension query URL setting events in Teams. The method must match the QuerySettingUrlHandler delegate signature.

[TeamsQuerySettingUrlRoute]
public Task<Response> OnQuerySettingUrlAsync(ITeamsTurnContext turnContext, ITurnState turnState, CancellationToken cancellationToken)
{
    return Task.FromResult(new Response
    {
        ComposeExtension = new Result
        {
            Type = ResultType.Config,
            SuggestedActions = new SuggestedActions
            {
                Actions = [new CardAction { Type = "openUrl", Value = "https://example.com/config" }]
            }
        }
    });
}

Alternatively, OnQuerySettingUrl(QuerySettingUrlHandler, String[], UInt16) can be used to register the handler via the fluent API.

Constructors

Name Description
TeamsQuerySettingUrlRouteAttribute(Boolean, UInt16, String)

Attribute to define a route that handles Teams message extension query URL setting events.

Methods

Name Description
AddRoute(AgentApplication, MethodInfo)

Applies to