Checking Sim swap events
Log in to Network as Code Developer Portal and head over to your Dashboard.
Then, click Create and manage organizations
and a new window will open,
from which you can select API Hub
on the top-right menu.
Click the top-left search box and just type in the API name SIM Swap
.
NOTE: Remember to subscribe to the SIM Swap API first, after which you will be able to click
Test Endpoint
and use the API. Here's a step-by-step on how to subscribe to APIs.
The Network as Code SIM Swap API has two endpoints:
-
Retrieve the latest SIM swap date (timestamp) with
POST retrieveSimSwapDate
.NOTE: If the SIM was not swapped recently, it will then return its activation date.
-
Check if a SIM was swapped within a specific span of
n
seconds withPOST checkSimSwap
.
Required and optional API fields
Required fields
-
RapidAPI App: It's simply the app name. Since multiple applications can be created for different use cases, if you or your organization previously created any apps, they will be accessible from this drop-down list.
-
Request URL: The specific endpoint or address where you will send your API request. In this case, the default option is RapidAPI.
Header Parameters:
-
X-RapidAPI-key: An
ENUM
value for your personal or organization application key, which was created through the API Management dashboard in the Getting Started steps or during enterprise onboarding. -
X-RapidAPI-Host: It uniquely identifies the API being called and the
string
value is already filled by default when you access the SIM Swap API.
Optional fields:
Header Parameters:
- X-correlator: An optional correlation ID parameter
in
string
format for different services. It's used to correlate or track requests and responses.
Retrieving the latest SIM swap date
The example below shows the request body with a test phone number.
Simply replace it with the number for which you want to retrieve the timestamp.
The POST retrieveSimSwapDate
endpoint returns a date-time
object.
{
"phoneNumber": "+346661113334"
}
Checking a specific SIM swap time span
The example below shows the request body with a test phone number.
Simply replace it with the one, for which you want to check the specific time span.
The POST checkSimSwap
endpoint returns a boolean
value.
NOTE: The
maxAge
parameters is defined in seconds. Remember to convert hours to seconds, for example, the amount of seconds in 1 hour is360
.
{
"phoneNumber": "+346661113334",
"maxAge": 360
}
Last updated on May 21, 2024