Package io.tokenchannel
Class TokenChannel
- java.lang.Object
-
- io.tokenchannel.TokenChannel
-
public class TokenChannel extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringTOKENCHANNEL_BASE_URI
-
Constructor Summary
Constructors Constructor Description TokenChannel(TokenChannelProperties properties, com.google.gson.Gson gson)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticateResponseauthenticate(String requestId, String authCode)Verifies a previously created challengeChallengeResponsechallenge(ChannelType channel, String identifier, ChallengeOptions options)Creates a challenge, ie, generates a token to be sent by a given a channel to a given identifierList<SMSPriceItem>getSMSPrices()Retrieves the SMS pricing list for supported countriesList<String>getSupportedCountries()Retrieves the countries TokenChannel service is availableList<String>getSupportedLanguages()Retrieves the available languages or locales for the token notification templatesTestResponsegetValidationCodeByTestChallengeId(String requestId)Retrieves the validation code of a challenge that was previously created with test mode enabledList<VoicePriceItem>getVoicePrices()Retrieves the voice call pricing list for supported countries
-
-
-
Field Detail
-
TOKENCHANNEL_BASE_URI
public static final String TOKENCHANNEL_BASE_URI
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TokenChannel
public TokenChannel(TokenChannelProperties properties, com.google.gson.Gson gson)
-
-
Method Detail
-
challenge
public ChallengeResponse challenge(ChannelType channel, String identifier, ChallengeOptions options)
Creates a challenge, ie, generates a token to be sent by a given a channel to a given identifier- Parameters:
channel- - The channel the token is being deliveredidentifier- - the customer identifier in the given channeloptions- - The challenge workflow configuration- Throws:
InvalidIdentifierException- whether the identifier is invalid for the given channelTargetOptOutException- whether the target user opted out this service via this channelBadRequestException- whether there is an invalid value in the request. The field errorInfo in the BadRequestError describes the invalid valueOutOfBalanceException- whether there is not enough balance to attend a balance consumer challenge creationForbiddenException- whether requesting an action that provided api key is not allowedUnauthorizedException- whether an invalid api key value is providedQuotaExceededException- whether Sandbox quota, QPS o QPM have been exceeded
-
authenticate
public AuthenticateResponse authenticate(String requestId, String authCode)
Verifies a previously created challenge- Parameters:
requestId- - The handle to a given challengeauthCode- - The token or validation code to try challenge authentication- Throws:
InvalidCodeException- whether the token or validation code provide is invalidBadRequestException- whether the requestId format is invalidChallengeClosedException- whether the challenge is closed and no interaction is expectedChallengeExpiredException- whether the challenge validity is overChallengeNotFoundException- whether the requestId is well formatted but a challenge for that id cannot be foundMaxAttemptsExceededException- whether the max number ot attempts allowed has been reachedForbiddenException- whether requesting an action that provided api key is not allowed to performUnauthorizedException- whether an invalid api key value is providedQuotaExceededException- whether Sandbox quota, QPS o QPM have been exceeded
-
getValidationCodeByTestChallengeId
public TestResponse getValidationCodeByTestChallengeId(String requestId)
Retrieves the validation code of a challenge that was previously created with test mode enabled- Parameters:
requestId- - The handle to a given challenge- Throws:
BadRequestException- whether the requestId format is invalidForbiddenException- whether requesting an action that provided api key is not allowed to performUnauthorizedException- whether an invalid api key value is providedQuotaExceededException- whether QPS o QPM have been exceeded
-
getSupportedCountries
public List<String> getSupportedCountries()
Retrieves the countries TokenChannel service is available- Throws:
QuotaExceededException- whether QPS o QPM have been exceeded
-
getSupportedLanguages
public List<String> getSupportedLanguages()
Retrieves the available languages or locales for the token notification templates- Throws:
QuotaExceededException- whether QPS o QPM have been exceeded
-
getSMSPrices
public List<SMSPriceItem> getSMSPrices()
Retrieves the SMS pricing list for supported countries- Throws:
QuotaExceededException- whether QPS o QPM have been exceeded
-
getVoicePrices
public List<VoicePriceItem> getVoicePrices()
Retrieves the voice call pricing list for supported countries- Throws:
QuotaExceededException- whether QPS o QPM have been exceeded
-
-