Class RestRepository
- java.lang.Object
-
- io.github.signalwirecommunity.repository.RestRepository
-
public class RestRepository extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description RestRepository(java.lang.String projectId, java.lang.String apiToken, java.lang.String spaceName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VerifyCaller.CallerId
createCallerId(java.lang.String name, java.lang.String extension, java.lang.String number)
To send a verification call to a number, you send a POST request to the Verified Caller ID resource.SuccessResponse
deleteCallerId(java.lang.String id)
Permanently deletes a Verified Caller ID.VerifyCaller.CallerId
getCallerId(java.lang.String id)
To retrieve an existing Verified Caller ID, you send a GET request to the Verified Caller ID resource.VerifyCaller
listVerifyCallerIds()
Returns a list of your Verified Caller IDs.MfaResponse
performMfa(java.lang.String url, int type, java.lang.String to, java.lang.String from, java.lang.String message)
LookUp
phoneLookUp(java.lang.String phoneNumber)
This endpoint allows you to look up validity and formatting information about a number.VerifyCaller.CallerId
redialVerification(java.lang.String id)
MfaResponse
sendMfa(int type, java.lang.String to, java.lang.String from, java.lang.String message)
Multi-factor authenticationVerifyCaller.CallerId
updateCallerId(java.lang.String id, java.lang.String name)
o update an existing Verified Caller ID, you send a `PUT request to the Verified Caller ID resource.VerifyCaller.CallerId
validateCallerId(java.lang.String id, java.lang.String verification_code)
Supplies the verification code that was read during the verification call.SuccessResponse
verifyMfa(java.lang.String mfaId, java.lang.String token)
-
-
-
Method Detail
-
phoneLookUp
public LookUp phoneLookUp(java.lang.String phoneNumber)
This endpoint allows you to look up validity and formatting information about a number. You can optionally lookup additional information about the number such as carrier and caller ID data.- Parameters:
phoneNumber
- Phone number to look up- Returns:
- LookUp
-
sendMfa
public MfaResponse sendMfa(int type, java.lang.String to, java.lang.String from, java.lang.String message) throws SignalWireException
Multi-factor authentication- Parameters:
type
- type of Multifactor authentication 1 for sms and 2 for voice- Returns:
- MfaResponse
- Throws:
SignalWireException
-
performMfa
public MfaResponse performMfa(java.lang.String url, int type, java.lang.String to, java.lang.String from, java.lang.String message) throws SignalWireException
- Throws:
SignalWireException
-
verifyMfa
public SuccessResponse verifyMfa(java.lang.String mfaId, java.lang.String token) throws SignalWireException
- Throws:
SignalWireException
-
listVerifyCallerIds
public VerifyCaller listVerifyCallerIds()
Returns a list of your Verified Caller IDs. The caller IDs are returned sorted by creation date, with the most recent caller IDs appearing first.- Returns:
- VerifyCaller
-
createCallerId
public VerifyCaller.CallerId createCallerId(java.lang.String name, java.lang.String extension, java.lang.String number) throws SignalWireException
To send a verification call to a number, you send a POST request to the Verified Caller ID resource.- Parameters:
name
- Name of the call numbeerextension
- Extension of the phone numbernumber
- Phone number- Returns:
- CallerId
- Throws:
SignalWireException
-
getCallerId
public VerifyCaller.CallerId getCallerId(java.lang.String id)
To retrieve an existing Verified Caller ID, you send a GET request to the Verified Caller ID resource. Use the unique ID that was returned from your previous request to identify the specific Verified Caller ID.- Parameters:
id
- id of the caller Id- Returns:
- CallerId
-
updateCallerId
public VerifyCaller.CallerId updateCallerId(java.lang.String id, java.lang.String name) throws SignalWireException
o update an existing Verified Caller ID, you send a `PUT request to the Verified Caller ID resource. Any parameters not passed in will remain unchanged.- Parameters:
id
- id of the callerIDname
- name of the callerId- Returns:
- CallerId
- Throws:
SignalWireException
-
deleteCallerId
public SuccessResponse deleteCallerId(java.lang.String id)
Permanently deletes a Verified Caller ID. You will no longer be able to place calls from this phone number.- Parameters:
id
- unique id of the callerId- Returns:
- SuccessResponse
-
validateCallerId
public VerifyCaller.CallerId validateCallerId(java.lang.String id, java.lang.String verification_code) throws SignalWireException
Supplies the verification code that was read during the verification call.- Parameters:
id
- unique id of the Verification IDverification_code
- code sent to either sms or phone- Returns:
- CalleriD
- Throws:
SignalWireException
-
redialVerification
public VerifyCaller.CallerId redialVerification(java.lang.String id) throws SignalWireException
- Throws:
SignalWireException
-
-