Menu

Expand
Rate this page:

Using Verify Silent Network Auth with Twilio Regions

Test SNA Today

Get Started

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.

Overview

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.

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.

Limitations

  • 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.

Quickstart

Step 1: Authentication

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.
  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

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

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.

curl -X POST "https://verify.dublin.ie1.twilio.com/v2/Services" \
--data-urlencode "FriendlyName=My IE1 Verify Service" \
-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

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 VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX with the SID of your IE1 Verify Service and +447440963594 with the phone number you’d like to verify.

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

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

const accountSid = process.env.ACCOUNT_SID;
const apiKey = process.env.API_KEY_SID;
const apiKeySecret = process.env.API_KEY_SECRET;

const client = require('twilio')(
     apiKey,
     apiKeySecret, 
     {
          accountSid: accountSid,
          edge: 'dublin',
          region: 'ie1'
     }
);

client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
     .verifications
     .create({to: '+447440963594', channel: 'sna'})
     .then(verification => console.log(verificaiton.sid));

Step 5: Invoke the SNA URL

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

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 VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX with the SID of your IE1 Verify Service and +447440963594 with the phone number you verified.

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

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

        
        
        

        Thank you for your feedback!

        Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        Refer us and get $10 in 3 simple steps!

        Step 1

        Get link

        Get a free personal referral link here

        Step 2

        Give $10

        Your user signs up and upgrade using link

        Step 3

        Get $10

        1,250 free SMSes
        OR 1,000 free voice mins
        OR 12,000 chats
        OR more