共用方式為


OptOutsClient.Add Method

Definition

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

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