tru.ID logo
LoginSignup

Using Sandbox Mode

Docs

Using Sandbox Mode

tru.ID Projects can be set to a mode of sandbox where API requests do not result in interactions with MNOs (Mobile Network Operators) and no costs are incurred. In Sandbox mode API requests and workflows follow a set of deterministic rules that can be used to facilitate development and testing.

How to Create a Project in Sandbox Mode

A project can be created using the API. See Create a Project in the API Reference.

To create a project in sandbox mode use the CLI with --mode sandbox:

$ tru projects:create "Project Name" --mode sandbox

How to Update a Project to Sandbox Mode

A project can be updated using the API. See Update a Project in the API Reference.

To update a project to sandbox mode using the tru.ID CLI, run the following command from within a directory with a tru.json configuration file:

$ tru projects:update --mode sandbox

If the tru.json is within another directory use the --project-dir flag:

$ tru projects:update --mode sandbox --project-dir /path/to/dir/with/config/file

Sandbox Rules

Outlined below are the products and associated rules when a project has a mode set to sandbox.

PhoneCheck

Sandbox rules are applied based on the phone_number value used when creating a PhoneCheck resource. Once the Check URL has been requested the resource will transition to have status and match values determined by the following rules:

phone_number Suffixmatchstatus
An even digit: (0, 2, 4 ...)trueCOMPLETED
An odd digit: (1, 3, 5 ...)falseCOMPLETED
99 falseERROR

SIMCheck

Sandbox rules are applied based on the phone_number value used when creating a SIMCheck resource. The value of no_sim_change and status will be set based on the following logic:

phone_number Suffixno_sim_changestatus
An even digit: (0, 2, 4 ...)trueCOMPLETED
An odd digit: (1, 3, 5 ...)falseCOMPLETED
99 N/AERROR

SubscriberCheck

Sandbox rules are applied based on the phone_number value used when creating a SubscriberCheck resource. Once the Check URL has been requested the resource will transition to have status and match values determined by the following rules:

phone_number Suffixmatchstatus
Even digits: (0, 2, 4 ...)trueCOMPLETED
Odd digit: (1, 3, 5 ...)falseCOMPLETED
99 falseERROR

Device Reachability

Sandbox rules are applied based on the ip (IP Address) value used when querying the reachability of a device. The responses to the HTTP GET request will be as follows:

IP Address SuffixResult MeaningHTTP Status CodePayload
Even digit: (0, 2, 4 ...)Success200JSON result
Odd digit: (1, 3, 5 ...)Not a Mobile IP Address412JSON HTTP Problem
99 MNO Not Supported400JSON HTTP Problem

Example: IP Address Ending in an Even number

$ tru coverage:reach 127.0.0.2
network_id network_name country_code supported_products
00000 Sandbox MNO ZZ Phone Check,Sim Check,Subscriber Check

Example: IP Address Ending in an Odd number

$ tru coverage:reach 127.0.0.1
API Error: Error: Request failed with status code 412 {
"type": "https://developer.tru.id/docs/reference/api-errors#not_mobile_ip",
"title": "Precondition Failed",
"status": 412,
"detail": "Not a mobile IP"
}
› Error: failed to retrieve reach: EEXIT: 1

Example: IP Address Ending in 99

$ tru coverage:reach 127.0.0.99
API Error: Error: Request failed with status code 400 {
"type": "https://developer.tru.id/docs/reference/api-errors#mno_not_supported",
"title": "Bad Request",
"status": 400,
"detail": "MNO not supported"
}
› Error: failed to retrieve reach: EEXIT: 1
tru.ID logo

Platform

Docs

DON'T MISS A BEAT — STAY ON THE DOT!

Keep current with industry news and updates from tru.ID.

Follow us on:

Made with ❤️ across the 🌍

© 2021 4Auth Limited. All rights reserved. tru.ID is the trading name of 4Auth Limited.