Share via


SimSwap.Verify Method

Definition

Overloads

Verify(String, SimSwapVerificationContent, CancellationToken)

Verifies if a SIM swap has been performed during a past period (defined in the request with 'maxAgeHours' attribute). Returns 'True' if a SIM swap has occured.

Verify(String, RequestContent, RequestContext)

[Protocol Method] Verifies if a SIM swap has been performed during a past period (defined in the request with 'maxAgeHours' attribute). Returns 'True' if a SIM swap has occured.

Verify(String, SimSwapVerificationContent, CancellationToken)

Source:
SimSwap.cs

Verifies if a SIM swap has been performed during a past period (defined in the request with 'maxAgeHours' attribute). Returns 'True' if a SIM swap has occured.

public virtual Azure.Response<Azure.Communication.ProgrammableConnectivity.SimSwapVerificationResult> Verify (string apcGatewayId, Azure.Communication.ProgrammableConnectivity.SimSwapVerificationContent simSwapVerificationContent, System.Threading.CancellationToken cancellationToken = default);
abstract member Verify : string * Azure.Communication.ProgrammableConnectivity.SimSwapVerificationContent * System.Threading.CancellationToken -> Azure.Response<Azure.Communication.ProgrammableConnectivity.SimSwapVerificationResult>
override this.Verify : string * Azure.Communication.ProgrammableConnectivity.SimSwapVerificationContent * System.Threading.CancellationToken -> Azure.Response<Azure.Communication.ProgrammableConnectivity.SimSwapVerificationResult>
Public Overridable Function Verify (apcGatewayId As String, simSwapVerificationContent As SimSwapVerificationContent, Optional cancellationToken As CancellationToken = Nothing) As Response(Of SimSwapVerificationResult)

Parameters

apcGatewayId
String

The identifier of the APC Gateway resource which should handle this request.

simSwapVerificationContent
SimSwapVerificationContent

Request to verify SimSwap in period.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

apcGatewayId or simSwapVerificationContent is null.

Examples

This sample shows how to call Verify.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview");

SimSwapVerificationContent simSwapVerificationContent = new SimSwapVerificationContent(new NetworkIdentifier("<identifierType>", "<identifier>"));
Response<SimSwapVerificationResult> response = client.Verify("<apcGatewayId>", simSwapVerificationContent);

This sample shows how to call Verify with all parameters.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview");

SimSwapVerificationContent simSwapVerificationContent = new SimSwapVerificationContent(new NetworkIdentifier("<identifierType>", "<identifier>"))
{
    PhoneNumber = "<phoneNumber>",
    MaxAgeHours = 1234,
};
Response<SimSwapVerificationResult> response = client.Verify("<apcGatewayId>", simSwapVerificationContent);

Applies to

Verify(String, RequestContent, RequestContext)

Source:
SimSwap.cs

[Protocol Method] Verifies if a SIM swap has been performed during a past period (defined in the request with 'maxAgeHours' attribute). Returns 'True' if a SIM swap has occured.

public virtual Azure.Response Verify (string apcGatewayId, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member Verify : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
override this.Verify : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
Public Overridable Function Verify (apcGatewayId As String, content As RequestContent, Optional context As RequestContext = Nothing) As 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 Verify and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview");

using RequestContent content = RequestContent.Create(new
{
    networkIdentifier = new
    {
        identifierType = "<identifierType>",
        identifier = "<identifier>",
    },
});
Response response = client.Verify("<apcGatewayId>", content);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("verificationResult").ToString());

This sample shows how to call Verify with all parameters and request content and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview");

using RequestContent content = RequestContent.Create(new
{
    phoneNumber = "<phoneNumber>",
    maxAgeHours = 1234,
    networkIdentifier = new
    {
        identifierType = "<identifierType>",
        identifier = "<identifier>",
    },
});
Response response = client.Verify("<apcGatewayId>", content);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("verificationResult").ToString());

Applies to