Language

SlackAgentExtension.CallAsync Method

Definition

Invokes a Slack Web API method asynchronously using the specified context and parameters.

public System.Threading.Tasks.Task<Microsoft.Agents.Extensions.Slack.Api.SlackResponse> CallAsync(Microsoft.Agents.Builder.ITurnContext turnContext, string method, object? options = default, string token = "", System.Threading.CancellationToken cancellationToken = default);
member this.CallAsync : Microsoft.Agents.Builder.ITurnContext * string * obj * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.Extensions.Slack.Api.SlackResponse>
Public Function CallAsync (turnContext As ITurnContext, method As String, Optional options As Object = Nothing, Optional token As String = "", Optional cancellationToken As CancellationToken = Nothing) As Task(Of SlackResponse)

Parameters

turnContext
ITurnContext

The turn context that provides access to the Slack API service and conversation state. Cannot be null.

method
String

The name of the Slack Web API method to call. Must be a valid Slack API method name.

options
Object

An optional object containing parameters to include in the API request. May be null if no additional options are required.

token
String

An optional Slack authentication token to use for the API call. If empty, the request is sent without an Authorization header.

cancellationToken
CancellationToken

A cancellation token that can be used to cancel the asynchronous operation.

Returns

A task that represents the asynchronous operation. The task result contains the response from the Slack API.

Applies to