tru.ID logo
LoginSignup

Device Reachability

Docs

Device Reachability

tru.ID Reachability is a new feature that enables applications to check whether the SIM card within a user’s device is on a network that tru.ID has connectivity to. The API request returns information about the mobile network that the device is on, and will produce any products that may be supported based on the IP address provided.

The API

A GET request is made to the following URL: https://{data_residency}.api.tru.id/public/coverage/v0.1/device_ip.

On the device, the following is checked:

  • Is the IP address a cellular or landline IP address?
  • Is the Mobile Network Operator (MNO) supported?
  • Which products are supported?

For a successful phone/subscriber check, the device needs to be on a cellular IP address. The mobile SDKs force the device to make the request over cellular data rather than Wi-Fi.

If you are making the API request manually within the project, you will need to write functionality to force the request over cellular data, or request the person using the application to turn Wi-Fi off.

The SDKs that have support for this functionality are:

  • the Android SDK,
  • the iOS SDK,
  • the React Native SDK,
  • the Flutter SDK,
  • the Ionic / Capacitor plugin

What information is returned?

If the IP address is a cellular IP address and is supported by the MNO, then the HTTP status code returned will be 200 along with the following JSON body:

{
"network_id": "23410",
"network_name": "O2 UK",
"country_code": "GB",
"products": [
{
"product_id": "PCK",
"product_name": "PhoneCheck"
}
]
}

If the IP address is a cellular (3/4/5G) IP address but is not supported by the MNO, then the HTTP status code returned will be 400 along with the following JSON body:

{
"type": "https://developer.tru.id/docs/reference/api-errors#mno_not_supported"
}

In this case, you should fall back to another method of verifying the phone number.

If the IP address is not on a cellular (3/4/5G) connection, then the reachability check will fail as it cannot verify whether the mobile network operator (MNO) for the device is supported. The HTTP status code returned will be 412 along with the following JSON body:

{
"type": "https://developer.tru.id/docs/reference/api-errors#not_mobile_ip"
}

Note: If using any of the SDKs except for the web SDK, the application can force a PhoneCheck through cellular data. This means that even if this response is returned in a Reachability check, a PhoneCheck is still possible. If you’re making the reachability check while implementing Phone/Subscriber checks on a mobile website, you may want to use this error to trigger a notification to the user to turn off WiFi antenna on their device and retry the verification through tru.ID.

More information on the Reachability API can be found on the API Reference.

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.