Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Testing SIM Swap with Magic Numbers


(warning)

Warning

Please review the Magic Numbers for Lookup and use your testing credentials for the correct Region when testing phone numbers. If you use your production credentials then the phone numbers do not display the correct responses shown below.

Note: Your testing credentials are region specific so make sure you have selected the region you want to test in the top right corner of the Auth Tokens page of your Console(link takes you to an external page) before testing phone numbers.


SIM Swap Magic Numbers

sim-swap-magic-numbers page anchor

These phone numbers have simulated information for the following inputs which is for testing the SIM Swap feature. Testing SIM Swap with Magic Numbers works just like SIM Swap in Production and only requires you to submit the phone number with your query. Note: These phone numbers are examples only and do not include real time data.

Below are the Magic Numbers for SIM Swap, along with their Inputs/Outputs:

below-are-the-magic-numbers-for-sim-swap-along-with-their-inputsoutputs page anchor

These phone number examples show the inputs (phone numbers) and their outputs (LastSimSwapDate, SwappedPeriod and SwappedinPeriod).

Phone NumberLastSimSwapDateSwappedPeriodSwappedInPeriod
+12345678900nullPT48HFALSE
+441234567890"2018-07-25T11:47:40Z"PT48HFALSE
+491534567890"2018-07-25T11:47:40Z"PT48HFALSE
+3933444567890nullPT48HFALSE
+31223456780"2018-07-25T11:47:40Z"PT48HFALSE
+34712345670"2018-07-25T11:47:40Z"PT48HFALSE
+551234567890nullPT48HFALSE
+573394567890nullPT48HFALSE
+12345678904nullPT48HTRUE
+441234567891"2020-04-27T10:18:50Z"PT48HTRUE
+491534567891"2020-04-27T10:18:50Z"PT48HTRUE
+3933444567891nullPT48HTRUE
+31223456781"2020-04-27T10:18:50Z"PT48HTRUE
+34712345671"2020-04-27T10:18:50Z"PT48HTRUE
+551234567891nullPT48HTRUE
+573394567891nullPT48HTRUE

These phone number examples show different types of errors when using SIM Swap.

Phone NumberError Code
+1234567890560004
+1234567890660005
+1234567890760006
+1234567890960008
+1234567891060601
+1234567891160606
+1234567891260607
+1234567891360608
+1234567891460614
+1234567891560619
+1234567891660620

SIM Swap Lookup

sim-swap-lookup page anchor

SIM swap date and timestamp returned (paid)

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.lookups.v2.phoneNumbers('+447772000001')
_10
.fetch({fields: 'sim_swap'})
_10
.then(phone_number => console.log(phone_number.simSwap));

Output

_29
{
_29
"calling_country_code": "44",
_29
"country_code": "GB",
_29
"phone_number": "+447772000001",
_29
"national_format": "07772 000001",
_29
"valid": true,
_29
"validation_errors": null,
_29
"caller_name": null,
_29
"sim_swap": {
_29
"last_sim_swap": {
_29
"last_sim_swap_date": "2020-04-27T10:18:50Z",
_29
"swapped_period": "PT48H",
_29
"swapped_in_period": true
_29
},
_29
"carrier_name": "Vodafone UK",
_29
"mobile_country_code": "276",
_29
"mobile_network_code": "02",
_29
"error_code": null
_29
},
_29
"call_forwarding": null,
_29
"line_status": null,
_29
"line_type_intelligence": null,
_29
"identity_match": null,
_29
"reassigned_number": null,
_29
"sms_pumping_risk": null,
_29
"phone_number_quality_score": null,
_29
"pre_fill": null,
_29
"url": "https://lookups.twilio.com/v2/PhoneNumbers/+447772000001"
_29
}


Rate this page: