Skip to main content
Version: Java

Quickstart

This guide will help you get started with the SIM Swap API. You will learn how to initialize the SDK, send a SIM Swap request, and handle the response.

Prerequisites

Before you begin, you need to have the following:

Step 1: Get your API Credentials

To get your API Credentials, you can go to the SIM Swap Product Page and click on "Manage on Provider" to access the service dashboard. For a full guide on how to get your credentials, you can refer to the Registration guide.

Step 2: Create a new project

Create a new folder and enter the folder from a terminal.

mkdir sim-swap-test
cd sim-swap-test

Step 3: Initialize the application

gradle init --type java-application

Step 4: Add the Glide SDK Dependency

Open the build.gradle file and add the Glide SDK dependency inside the dependencies block:

dependencies {
// Other dependencies

// Glide SDK
implementation("com.glideapi:glide-sdk-java:1.0.2")
}
info

make sure to sync the project after adding the dependency or run the following command:

./gradlew build

Step 5: Send a SIM Swap request

App.java
import com.glideapi.GlideClient;
import com.glideapi.Types.UserIdentifier.PhoneIdentifier;
import com.glideapi.services.SimSwapClient;

public class App {

public static String PHONE_NUMBER = "+555123456789";

public static void main(String[] args) throws Exception {
GlideClient glideClient = new GlideClient(<GLIDE_CLIENT_ID>, <GLIDE_CLIENT_SECRET>);
PhoneIdentifier identifier = new PhoneIdentifier(PHONE_NUMBER);
SimSwapClient.SimSwapUserClient simSwapClient = glideClient.simSwap.forUser(identifier);
SimSwapClient.SimSwapUserClient.SimSwapCheckParams params = new SimSwapClient.SimSwapUserClient.SimSwapCheckParams();
SimSwapClient.SimSwapUserClient.SimSwapCheckResponse simSwapRes = simSwapClient.check(params, null);
System.out.println("sim swap response - swapped: " + simSwapRes.swapped);
}
}

To execute this you can run the following from your IDE or you can use the following command:

./gradlew run