共用方式為


OptOutsClient.AddAsync Method

Definition

Opts out to phone numbers from receiving SMS from from phone number.

public virtual System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutAddResponseItem>>> AddAsync (string from, System.Collections.Generic.IEnumerable<string> to, System.Threading.CancellationToken cancellationToken = default);
abstract member AddAsync : string * seq<string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutAddResponseItem>>>
override this.AddAsync : string * seq<string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Communication.Sms.Models.OptOutAddResponseItem>>>
Public Overridable Function AddAsync (from As String, to As IEnumerable(Of String), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of IReadOnlyList(Of OptOutAddResponseItem)))

Parameters

from
String

The sender's phone number that is owned by the authenticated account.

to
IEnumerable<String>

The recipient's phone number which should be opted out.

cancellationToken
CancellationToken

The cancellation token for the task.

Returns

Exceptions

The server returned an error. See Message for details returned from the server.

to is null.

Applies to