Package com.vonage.client.camara.simswap
Class SimSwapClient
java.lang.Object
com.vonage.client.camara.NetworkApiClient
com.vonage.client.camara.simswap.SimSwapClient
A client for communicating with the Vonage SIM Swap API. The standard way to obtain an instance
of this class is to use
VonageClient.getSimSwapClient().-
Field Summary
Fields inherited from class com.vonage.client.camara.NetworkApiClient
networkAuthClient -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckSimSwap(String phoneNumber) Check if SIM swap has been performed within the last 240 hours for the given phone number.booleancheckSimSwap(String phoneNumber, int maxAgeHours) Check if SIM swap has been performed during the specified past period for the given phone number.retrieveSimSwapDate(String phoneNumber) Get timestamp of last MSISDN to IMSI pairing change for a mobile user account.Methods inherited from class com.vonage.client.camara.NetworkApiClient
getCamaraBaseUri, setNetworkAuth, setNetworkAuth
-
Constructor Details
-
SimSwapClient
Create a new SimSwapClient.- Parameters:
wrapper- Http Wrapper used to create requests.
-
-
Method Details
-
checkSimSwap
Check if SIM swap has been performed within the last 240 hours for the given phone number. Use checkSimSwap(String, int) to specify the time period.- Parameters:
phoneNumber- Subscriber number in E.164 format (starting with country code). Optionally prefixed with '+'.- Returns:
trueif the SIM card has been swapped during the period within the provided age.- Throws:
CamaraResponseException- If the request was unsuccessful. This could be for the following reasons:- 400: Invalid request arguments.
- 401: Request not authenticated due to missing, invalid, or expired credentials.
- 403: Client does not have sufficient permissions to perform this action.
- 404: SIM Swap can't be checked because the phone number is unknown.
- 409: Another request is created for the same MSISDN.
- 502: Bad gateway.
-
checkSimSwap
Check if SIM swap has been performed during the specified past period for the given phone number.- Parameters:
phoneNumber- Subscriber number in E.164 format (starting with country code). Optionally prefixed with '+'.maxAgeHours- Period in hours to be checked for SIM swap. Must be between 1 and 2400.- Returns:
trueif the SIM card has been swapped during the period within the provided age.- Throws:
CamaraResponseException- If the request was unsuccessful. This could be for the following reasons:- 400: Invalid request arguments.
- 401: Request not authenticated due to missing, invalid, or expired credentials.
- 403: Client does not have sufficient permissions to perform this action.
- 404: SIM Swap can't be checked because the phone number is unknown.
- 409: Another request is created for the same MSISDN.
- 502: Bad gateway.
-
retrieveSimSwapDate
Get timestamp of last MSISDN to IMSI pairing change for a mobile user account.- Parameters:
phoneNumber- Subscriber number in E.164 format (starting with country code). Optionally prefixed with '+'.- Returns:
- Time of the latest SIM swap performed, or
nullif unknown / not applicable. - Throws:
CamaraResponseException- If the request was unsuccessful. This could be for the following reasons:- 400: Invalid request arguments.
- 401: Request not authenticated due to missing, invalid, or expired credentials.
- 403: Client does not have sufficient permissions to perform this action.
- 404: SIM Swap can't be checked because the phone number is unknown.
- 409: Another request is created for the same MSISDN.
- 502: Bad gateway.
-