NumberVerification.VerifyWithoutCodeAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
VerifyWithoutCodeAsync(String, NumberVerificationWithoutCodeContent, CancellationToken) |
Verifies the phone number (MSISDN) associated with a device. As part of the frontend authorization flow, the device is redirected to the operator network to authenticate directly. |
VerifyWithoutCodeAsync(String, RequestContent, RequestContext) |
[Protocol Method] Verifies the phone number (MSISDN) associated with a device. As part of the frontend authorization flow, the device is redirected to the operator network to authenticate directly.
|
VerifyWithoutCodeAsync(String, NumberVerificationWithoutCodeContent, CancellationToken)
- Source:
- NumberVerification.cs
Verifies the phone number (MSISDN) associated with a device. As part of the frontend authorization flow, the device is redirected to the operator network to authenticate directly.
public virtual System.Threading.Tasks.Task<Azure.Response> VerifyWithoutCodeAsync (string apcGatewayId, Azure.Communication.ProgrammableConnectivity.NumberVerificationWithoutCodeContent numberVerificationWithoutCodeContent, System.Threading.CancellationToken cancellationToken = default);
abstract member VerifyWithoutCodeAsync : string * Azure.Communication.ProgrammableConnectivity.NumberVerificationWithoutCodeContent * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
override this.VerifyWithoutCodeAsync : string * Azure.Communication.ProgrammableConnectivity.NumberVerificationWithoutCodeContent * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function VerifyWithoutCodeAsync (apcGatewayId As String, numberVerificationWithoutCodeContent As NumberVerificationWithoutCodeContent, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response)
Parameters
- apcGatewayId
- String
The identifier of the APC Gateway resource which should handle this request.
- numberVerificationWithoutCodeContent
- NumberVerificationWithoutCodeContent
Request to verify number of device - first call.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
apcGatewayId
or numberVerificationWithoutCodeContent
is null.
Examples
This sample shows how to call VerifyWithoutCodeAsync.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview");
NumberVerificationWithoutCodeContent numberVerificationWithoutCodeContent = new NumberVerificationWithoutCodeContent(new NetworkIdentifier("<identifierType>", "<identifier>"), new Uri("http://localhost:3000"));
Response response = await client.VerifyWithoutCodeAsync("<apcGatewayId>", numberVerificationWithoutCodeContent);
This sample shows how to call VerifyWithoutCodeAsync with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview");
NumberVerificationWithoutCodeContent numberVerificationWithoutCodeContent = new NumberVerificationWithoutCodeContent(new NetworkIdentifier("<identifierType>", "<identifier>"), new Uri("http://localhost:3000"))
{
PhoneNumber = "<phoneNumber>",
HashedPhoneNumber = "<hashedPhoneNumber>",
};
Response response = await client.VerifyWithoutCodeAsync("<apcGatewayId>", numberVerificationWithoutCodeContent);
Applies to
VerifyWithoutCodeAsync(String, RequestContent, RequestContext)
- Source:
- NumberVerification.cs
[Protocol Method] Verifies the phone number (MSISDN) associated with a device. As part of the frontend authorization flow, the device is redirected to the operator network to authenticate directly.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler VerifyWithoutCodeAsync(String, NumberVerificationWithoutCodeContent, CancellationToken) convenience overload with strongly typed models first.
public virtual System.Threading.Tasks.Task<Azure.Response> VerifyWithoutCodeAsync (string apcGatewayId, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member VerifyWithoutCodeAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.VerifyWithoutCodeAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function VerifyWithoutCodeAsync (apcGatewayId As String, content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Response)
Parameters
- apcGatewayId
- String
The identifier of the APC Gateway resource which should handle this request.
- content
- RequestContent
The content to send as the body of the request.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The response returned from the service.
Exceptions
apcGatewayId
or content
is null.
Service returned a non-success status code.
Examples
This sample shows how to call VerifyWithoutCodeAsync.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview");
using RequestContent content = RequestContent.Create(new
{
networkIdentifier = new
{
identifierType = "<identifierType>",
identifier = "<identifier>",
},
redirectUri = "http://localhost:3000",
});
Response response = await client.VerifyWithoutCodeAsync("<apcGatewayId>", content);
Console.WriteLine(response.Status);
This sample shows how to call VerifyWithoutCodeAsync with all parameters and request content.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview");
using RequestContent content = RequestContent.Create(new
{
networkIdentifier = new
{
identifierType = "<identifierType>",
identifier = "<identifier>",
},
phoneNumber = "<phoneNumber>",
hashedPhoneNumber = "<hashedPhoneNumber>",
redirectUri = "http://localhost:3000",
});
Response response = await client.VerifyWithoutCodeAsync("<apcGatewayId>", content);
Console.WriteLine(response.Status);
Applies to
Azure SDK for .NET