Skip to contentSkip to navigationSkip to topbar
On this page

Using Verify Silent Network Auth with Twilio Regions


Test SNA Today

Skip the 2-4 week wait for carrier approvals and get directly to testing SNA with your own mobile number using the new Live Test Number feature.

Get Started

Overview

overview page anchor

To control data residency and optimize application performance, Verify developers can select the Twilio Region that their Silent Network Auth (SNA) request is processed out of.

Verify SNA currently operates in the following Regions:

  • United States (US1) - Default Region
  • Ireland (IE1)

To use this feature, you will need to create Region-specific authentication credentials and specify that target Region in your request. See Using the Twilio REST API in a non-US Region for more information on formulating these REST API or Twilio helper library/SDK requests. If no target Region is specified, the request will be handled in US1 by default. Keep in mind that Regions operate in full isolation from each other. Although Verify SNA does not store data beyond internal logging, its workload processing will happen in-Region. Read more on Twilio's Region Isolation Model here.

(warning)

Warning

Note that during this initial phase of the rollout of Twilio Regions, Twilio does not guarantee that all data will remain within your selected Region. For example, globally accessible Twilio resources like account-level billing and usage records are shared across all Regions.


  • Only the SNA channel of Verify is available in IE1 at this time. API requests to the Start New Verification endpoint using a channel other than sna will fail. We plan to support SMS and additional channels in the future.

  • The Verify v1 API is not currently available in IE1.


Step 1: Authentication

step-1-authentication page anchor

Before making an API request, you'll need to generate an API key specifically for the IE1 Region. You can then use this Region-specific API Key to authenticate Twilio API requests in the IE1 Region.

To create the key, follow these steps:

  1. Log in to the Twilio Console(link takes you to an external page).
  2. Click the Account menu in the upper right corner of the screen.
  3. Click API keys & tokens, under the Keys & Credentials heading.
  4. Select Ireland (IE1) from the Region dropdown list.
  5. Click the blue Create API key button.
  6. Enter a friendly name for the key (example: "Verify SNA with Twilio Regions").
  7. Leave Key type on the default option, "Standard".
  8. Click the blue Create API Key button.

Make a note of the API Key's SID and Secret. You will need this information to authenticate all IE1 API calls.

Step 2: Set up IE1 base API URL

step-2-set-up-ie1-base-api-url page anchor

For this Quickstart, we will be demonstrating the process using REST API calls. Read here for more information on selecting a Region for Twilio client libraries/SDKs.

To select the target Region of IE1 for a Verification, use this base URL for your API requests. The parameter dublin is the Edge Location of your request, which can be replaced with whichever Edge is closest to your application. See Edge Locations for a list of what Edges are available to you.

https://verify.dublin.ie1.twilio.com/

Step 3: Create a Verify Service in IE1

step-3-create-a-verify-service-in-ie1 page anchor

Use the Create a Verification Service endpoint with the IE1 base API URL to create a Verify Service in IE1. Existing Verify Services created in US1 will not work for the next steps.

The variables $TWILIO_API_KEY and $TWILIO_API_KEY_SECRET should resolve to the IE1 Region API Key SID and Secret that you created in Step 1.

1
curl -X POST "https://verify.dublin.ie1.twilio.com/v2/Services" \
2
--data-urlencode "FriendlyName=My IE1 Verify Service" \
3
-u $TWILIO_API_KEY:$TWILIO_API_KEY_SECRET

Make a note of the new Service's sid included in the response, it will be in the format VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. You will use this information in the next step.

Step 4: Start a new SNA Verification in IE1

step-4-start-a-new-sna-verification-in-ie1 page anchor

Use the Start New Verification endpoint with the IE1 API base URL to create a new Verification using the sna channel.

When making this request, replace VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXwith the SID of your IE1 Verify Service and +447440963594with the phone number you'd like to verify.

1
curl -X POST 'https://verify.dublin.ie1.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Verifications' \
2
--data-urlencode 'To=+447440963594' \
3
--data-urlencode 'Channel=sna' \
4
-u $TWILIO_API_KEY:$TWILIO_API_KEY_SECRET

Using one of the helper libraries, an equivalent Node.js request would look like:

1
const accountSid = process.env.ACCOUNT_SID;
2
const apiKey = process.env.API_KEY_SID;
3
const apiKeySecret = process.env.API_KEY_SECRET;
4
5
const client = require('twilio')(
6
apiKey,
7
apiKeySecret,
8
{
9
accountSid: accountSid,
10
edge: 'dublin',
11
region: 'ie1'
12
}
13
);
14
15
client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
16
.verifications
17
.create({to: '+447440963594', channel: 'sna'})
18
.then(verification => console.log(verificaiton.sid));
19

Step 5: Invoke the SNA URL

step-5-invoke-the-sna-url page anchor

Continue the SNA flow by invoking the sna.url property received in the response of the previous Start New Verification call from the client device. This part of the process is the same regardless of Region used, check out our existing API Reference or Testing Guide documentation for more details.

Step 6: Check the Verification Attempt result in IE1

step-6-check-the-verification-attempt-result-in-ie1 page anchor

Send a request to the Verification Check endpoint with the IE1 API base URL to confirm that the SNA URL invocation and Verification Attempt were successful.

When making this request, replace VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXwith the SID of your IE1 Verify Service and +447440963594with the phone number you verified.

1
curl -X POST 'https://verify.dublin.ie1.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/VerificationCheck' \
2
--data-urlencode 'To=+447440963594' \
3
-u $TWILIO_API_KEY:$TWILIO_API_KEY_SECRET

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.