Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 170 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
## [0.6.0](http://central.maven.org/maven2/com/telesign/telesign/0.6.0/) - 2016-10-20
- 2016-10-19
- Added tts_message, sms_message, push_message to smartVerify Api. Also updated Test cases.
- 2016-10-18
- Added text to speech (TTS) feature of Voice Verify to the Java SDK.
- Updated version to 0.6.0
- 2016-06-30
- Merge pull request #54 from Manmohan-TechM/July_2015
- 2016-06-24
- Merge pull request #53 from erikkai/patch-2
Formatting, link fix
- 2016-06-22
- Renaming resource variable(Code cleanup)
- TMR-141/142 : Changes done for handling changes in AuthMethod enumeration value, used when signing the Authentication header.

- 2016-06-21
- Formatting, link fix
One of the links broke, and it wasn't displaying correctly. This version corrects all of that. Also a problem with how it was showing a block of code.
- 2016-06-17
- Merge pull request #52 from erikkai/patch-1

- 2016-06-17
- Broken link, style changes, added punctuation
Changes were that simple - needed to correct summarized items listed in title.
- 2016-06-14
- Merge pull request #51 from erikkai/patch-1

- 2016-06-14
- Update readme.rst

- 2016-01-17
- Merge branch 'Manmohan-TechM-July_2015'

- 2016-01-15
- Changes done for throwing underlying IOException for better visibility of underlying subclasses in all APIs.

## [0.5.0](http://central.maven.org/maven2/com/telesign/telesign/0.5.0/) - 2016-01-15
- Merge pull request #32 from Manmohan-TechM/July_2015
Updated version to 0.5.0
- 2016-01-14
- Updated version to 0.5.0 - Changes done to configure Https protocol via constructor parameters, performed code cleanup to remove redundant code.

- 2016-01-05
- Merge pull request #26 from gibffe/base_url_refactor
Removing string literals from method bodies
- 2015-12-24
- Capitalising constants.

- 2015-12-16
- Renaming resource variables.

- 2015-12-16
- Merge branch 'master' of https://github.com/TeleSign/java_telesign into base_url_refactor

- 2015-12-16
- Capturing baseUrl and resources suffixes in static variables.

- 2015-12-16
- Capturing baseUrl and resource suffixes in static variables.

## [0.4.0](http://central.maven.org/maven2/com/telesign/telesign/0.4.0/) - 2015-12-03
- Merge pull request #24 from Manmohan-TechM/July_2015
Comitting changes for Verify Push, Verify Softtoken, Verify Registration, TLS.
- 2015-12-03
- updated version to 0.4.0

- 2015-12-03
- Updated for formatting issues.

- 2015-12-02
- Added verify status overloaded method.

- 2015-12-01
- For addressing TMR-90

- 2015-12-01
- added overloaded method to make in sync with previous versions

- 2015-12-01
- Added overloaded method for call.

- 2015-11-12
- Updated exception messages

- 2015-11-12
- Merge branch 'master' into July_2015
Conflicts:
src/com/telesign/verify/response/VerifyResponse.java

- 2015-11-12
- changes done for: - SmartVerify, Verify push, Verify softtoken, Verify Registration - set default TLS version to 1.2

- 2015-11-04
- Merge pull request #22 from gibffe/build_with_debug
Adding debug info to the jar. Generating sources jar during build.
- 2015-11-03
- Adding debug info to the jar. Generating sources jar during build.

- 2015-11-02
- Merge pull request #20 from gibffe/shared_gson_instance
Shared Gson instance
- 2015-11-02
- Preventing gson instance from being serialized. Adding verbose junit error output.

- 2015-10-13
- Merge branch 'shared_gson_instance' of https://github.com/gibffe/java_telesign into shared_gson_instance

- 2015-10-13
- Gson instance is thread safe - removing reduntand instantiations.

- 2015-10-13
- Gson instance is thread safe - removing reduntant instantiations.

- 2015-10-01
- Committing changes for Verify registration, smart Verify API's

## [0.3.0](http://central.maven.org/maven2/com/telesign/telesign/0.3.0/) - 2015-08-20
- Adding carrier info to PhoneID Live and Contact responses.

## [0.2.0](http://central.maven.org/maven2/com/telesign/telesign/0.2.0/) - 2015-08-19
- Merge branch 'Manmohan-TechM-July_2015'

- 2015-08-19
- Merge branch 'July_2015' of git://github.com/Manmohan-TechM/java_telesign into Manmohan-TechM-July_2015

- 2015-08-19
- Updated comments to PhoneId

- 2015-08-19
- Changes done as part of TMR-61 -PhoneID Score response - LZU-535-31903

- 2015-08-17
- Merge pull request #16 from Manmohan-TechM/July_2015
Removed special characters as it was giving errors while running Junit test
- 2015-08-17
- Removed special characters as it was giving errors while running Junit test.

- 2015-08-13
- Merge pull request #15 from Manmohan-TechM/July_2015
Adding pom.xml used while migrating to Maven central
- 2015-08-13
- Merge pull request #14 from daplay/master
use Locale.US for date header
- 2015-08-03
- Added Originating_ip & Session_id to PhoneId & Verify calls. Changes done as part of PD-14562.

## [0.1.0](http://central.maven.org/maven2/com/telesign/telesign/0.1.0/) - 2015-07-30
- Updated pom.xml

- 2015-07-17
- fixes date header locale

- 2015-07-29
- adding pom.xml used while migrating to Maven central

- 2015-07-20
- Merge pull request #13 from Manmohan-TechM/July_2015
Adding connect and read timeouts as configurable parameters.
- 2015-07-16
- Removed redundant 'url.openConnection() & additional timeouts'

- 2015-07-03
- Added carrier information to PhoneId Standard response. Change done as part of PD-16299.

- 2015-07-01
- Adding connect and read timeouts as configurable parameters.

- 2014-09-24
- Merge pull request #12 from dominicpezzuto/master
Specify UTF-8 encoding in ant build.xml file
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<groupId>com.telesign</groupId>
<artifactId>telesign</artifactId>
<packaging>pom</packaging>
<version>0.5.0</version>
<version>0.6.0</version>
<name>telesign</name>
<url>https://github.com/TeleSign/java_telesign</url>
<inceptionYear>2010</inceptionYear>
Expand Down
83 changes: 73 additions & 10 deletions src/com/telesign/verify/Verify.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,19 +222,29 @@ public VerifyResponse sms(String phone_number, String language, String verify_co
*/
public VerifyResponse call(String phone_number) {

return call(phone_number, null, null, null, 0, null, true, null, null, null);
return call(phone_number, null);
}

/**
* Delivers a verification code to the end user with a phone call. When the user answers their phone, the TeleSign server plays an automated voice message that contains the code.
* Use this overload when the user's native spoken language is not the default language (English). You specify the user's language in the <em>language</em> parameter.
* @param phone_number [Required] A string containing the users phone number.
* @param phone_number [Required] A string containing the user's phone number.
* @param language [Optional] A string containing the IETF language tag. For example, "fr-CA". Set this value to "null" to use English (the default).
* @return A {@link com.telesign.verify.response.VerifyResponse} object, which contains the JSON-formatted response body from the TeleSign server.
*/
public VerifyResponse call(String phone_number, String language) {

return call(phone_number, language, null, null, 0, null, true, null, null, null);
return call(phone_number, language, null, null, 0, null, true, null, null, null, null);
}
/**
* @param phone_number [Required] A string containing the user's phone number.
* @param language [Optional] A string containing the IETF language tag. For example, "fr-CA". Set this value to "null" to use English (the default).
* @param ttsMessage [Optional] Allows you to pass a text-to-speech (TTS) message with language. Ex String: Hello, your secret code is $$CODE$$. Thank you.
* @return A {@link com.telesign.verify.response.VerifyResponse} object, which contains the JSON-formatted response body from the TeleSign server.
*/
public VerifyResponse call(String phone_number, String language, String ttsMessage) {

return call(phone_number, language, null, null, 0, null, true, null, null, null, ttsMessage);
}

/**
Expand All @@ -250,7 +260,7 @@ public VerifyResponse call(String phone_number, String language) {
*/
public VerifyResponse call(String phone_number, String language, String originating_ip, String session_id) {

return call(phone_number, language, null, null, 0, null, true, originating_ip, session_id, null);
return call(phone_number, language, originating_ip, session_id, null);
}

/**
Expand All @@ -267,9 +277,26 @@ public VerifyResponse call(String phone_number, String language, String originat
*/
public VerifyResponse call(String phone_number, String language, String originating_ip, String session_id, String call_forward_action) {

return call(phone_number, language, null, null, 0, null, true, originating_ip, session_id, call_forward_action);
return call(phone_number, language, null, null, 0, null, true, originating_ip, session_id, call_forward_action, null);
}

/**
* Delivers a verification code to the end user with a phone call. When the user answers their phone, the TeleSign server plays an automated voice message that contains the code.
* Use this overload when the user's native spoken language is not the default language (English). You specify the user's language in the <em>language</em> parameter.
* @param phone_number [Required] A string containing the user�s phone number.
* @param language [Optional] A string containing the IETF language tag. For example, "fr-CA". Set this value to "null" to use English (the default).
* @param originating_ip [Optional] Your end users IP Address. This value must be in the format defined by IETF in the
* Internet-Draft document titled Textual Representation of IPv4 and IPv6 Addresses. Ex: originating_ip=192.168.123.456.
* Set it to null if not sending originating ip.
* @param session_id [Optional] Your end users session id. Set it to "null" if not sending session id.
* @param call_forward_action [Optional] A string containing call forward action
* @param ttsMessage [Optional] Allows you to pass a text-to-speech (TTS) message with language. Ex String: Hello, your secret code is $$CODE$$. Thank you.
* @return A {@link com.telesign.verify.response.VerifyResponse} object, which contains the JSON-formatted response body from the TeleSign server.
*/
public VerifyResponse call(String phone_number, String language, String originating_ip, String session_id, String call_forward_action, String ttsMessage) {

return call(phone_number, language, null, null, 0, null, true, originating_ip, session_id, call_forward_action, ttsMessage);
}
/**
* Delivers a verification code to the end user - with a phone call. When the user answers their phone, the TeleSign server plays an automated voice message that contains the code.
* Use this overload when:
Expand Down Expand Up @@ -315,7 +342,7 @@ public VerifyResponse call(String phone_number, String language, String verify_c
* @return A {@link com.telesign.verify.response.VerifyResponse} object, which contains the JSON-formatted response body from the TeleSign server.
*/
public VerifyResponse call(String phone_number , String language, String verify_code, String verify_method, int extension_type, String extension_template, boolean redial, String originating_ip, String session_id) {
return call(phone_number , language, verify_code, verify_method, extension_type, extension_template, redial, originating_ip, session_id, null);
return call(phone_number , language, verify_code, verify_method, extension_type, extension_template, redial, originating_ip, session_id, null, null);
}

/**
Expand All @@ -339,10 +366,11 @@ public VerifyResponse call(String phone_number , String language, String verify_
* Set it to null if not sending originating ip.
* @param session_id [Optional] Your end users session id. Set it to "null" if not sending session id.
* @param call_forward_action [Optional] A string containing call forward action
* @param ttsMessage [Optional] text to speech feature of Telesign gets used, <a href="https://developer.telesign.com/v2.0/docs/rest_api-verify-call#text-to-speech-tts-hints">TTS hints</a>
* @return A {@link com.telesign.verify.response.VerifyResponse} object, which contains the JSON-formatted response body from the TeleSign server.
*/
public VerifyResponse call(String phone_number , String language, String verify_code, String verify_method, int extension_type, String extension_template, boolean redial,
String originating_ip, String session_id, String call_forward_action) {
String originating_ip, String session_id, String call_forward_action, String ttsMessage) {

String result = null;

Expand Down Expand Up @@ -399,6 +427,9 @@ public VerifyResponse call(String phone_number , String language, String verify_
}
}

if(null != ttsMessage && !ttsMessage.isEmpty())
body += "&tts_message=" + URLEncoder.encode(ttsMessage, "UTF-8");

tr.setPostBody(body);
result = tr.executeRequest();
}
Expand Down Expand Up @@ -554,10 +585,30 @@ public VerifyResponse registration(String phone_number, String bundle_id, String
/**
* @param phone_number [Required] Your end user's phone number, including the country code.
* @param ucid [Required] A string the specifies one of the <a href="http://docs.telesign.com/rest/content/xt/xt-use-case-codes.html#xref-use-case-codes">Use Case Codes</a>.
* @param language [Optional] Determines the message for Verify SMS and Verify Push. IETF language tag is used in mapping languages codes to predefined templates.
* @param verify_code [Optional] The verification code used for the code challenge. By default, TeleSign automatically generates a six-digit value for you.
* @param preference [Optional] Allows customers to override the Smart Verify method selection. Customers can specify either "call", "sms" or "push" to be the recommended method to attempt.
* @param ignore_risk [Optional] If set to "true", allows customers to bypass blocking the request if the score is above the threshold value configured in the customer account.
* @param ttsMessage [Optional] Allows you to pass a text-to-speech (TTS) message with language. Language parameter must be used with this.
* @param pushMessage [Optional] Allows you to pass message that you want to Push. Ex String: Hello, your secret code is $$CODE$$. Thank you.
* @param smsMessage [Optional] Allows you to pass a message sent via sms . Ex String: Hello, your secret code is $$CODE$$. Thank you.
* @return A {@link com.telesign.verify.response.VerifyResponse} object, which contains the JSON-formatted response body from the TeleSign server.
*/
public VerifyResponse smartVerify(String phone_number, String ucid, String caller_id, String language, String verify_code, String preference, String ignore_risk, String ttsMessage, String pushMessage, String smsMessage){
return smartVerify(phone_number, ucid, caller_id, language, verify_code, preference, ignore_risk, null, null, ttsMessage, pushMessage, smsMessage);
}

/**
* @param phone_number [Required] Your end user's phone number, including the country code.
* @param ucid [Required] A string the specifies one of the <a href="http://docs.telesign.com/rest/content/xt/xt-use-case-codes.html#xref-use-case-codes">Use Case Codes</a>.
* @param language [Optional] Determines the message for Verify SMS and Verify Push. IETF language tag is used in mapping languages codes to predefined templates.
* @param verify_code [Optional] The verification code used for the code challenge. By default, TeleSign automatically generates a six-digit value for you.
* @param preference [Optional] Allows customers to override the Smart Verify method selection. Customers can specify either "call", "sms" or "push" to be the recommended method to attempt.
* @param ignore_risk [Optional] If set to "true", allows customers to bypass blocking the request if the score is above the threshold value configured in the customer account.
* @return A {@link com.telesign.verify.response.VerifyResponse} object, which contains the JSON-formatted response body from the TeleSign server.
*/
public VerifyResponse smartVerify(String phone_number, String ucid, String caller_id, String language, String verify_code, String preference, String ignore_risk){
return smartVerify(phone_number, ucid, caller_id, language, verify_code, preference, ignore_risk, null, null);
return smartVerify(phone_number, ucid, caller_id, language, verify_code, preference, ignore_risk, null, null, null, null, null);
}

/**
Expand All @@ -575,9 +626,12 @@ public VerifyResponse smartVerify(String phone_number, String ucid, String calle
* @param originating_ip [Optional] Your end users IP Address. This value must be in the format defined by IETF in the Internet-Draft document titled Textual Representation of IPv4 and IPv6 Addresses.
* </br>Ex: originating_ip=192.168.123.456. </br>Set it to null if not sending originating ip.
* @param session_id [Optional] Your end users session id. Set it to "null" if not sending session id.
* @param ttsMessage [Optional] Allows you to pass a text-to-speech (TTS) message with language. Language parameter must be used with this.
* @param pushMessage [Optional] Allows you to pass message that you want to Push. Ex String: Hello, your secret code is $$CODE$$. Thank you.
* @param smsMessage [Optional] Allows you to pass a message sent via sms . Ex String: Hello, your secret code is $$CODE$$. Thank you.
* @return A {@link com.telesign.verify.response.VerifyResponse} object, which contains the JSON-formatted response body from the TeleSign server.
*/
public VerifyResponse smartVerify(String phone_number, String ucid, String caller_id, String language, String verify_code, String preference, String ignore_risk, String originating_ip, String session_id){
public VerifyResponse smartVerify(String phone_number, String ucid, String caller_id, String language, String verify_code, String preference, String ignore_risk, String originating_ip, String session_id, String ttsMessage, String pushMessage, String smsMessage){
String result = null;

try {
Expand Down Expand Up @@ -614,7 +668,16 @@ public VerifyResponse smartVerify(String phone_number, String ucid, String calle

body += "&ignore_risk=" + URLEncoder.encode(ignore_risk, "UTF-8");
}


if(null != ttsMessage && !ttsMessage.isEmpty())
body += "&tts_message=" + URLEncoder.encode(ttsMessage, "UTF-8");

if(null != pushMessage && !pushMessage.isEmpty())
body += "&push_message=" + URLEncoder.encode(pushMessage, "UTF-8");

if(null != smsMessage && !smsMessage.isEmpty())
body += "&sms_message=" + URLEncoder.encode(smsMessage, "UTF-8");

if(null != originating_ip && !originating_ip.isEmpty() && IpValidator.isValidIpAddress(originating_ip)) {

body += "&originating_ip=" + URLEncoder.encode(originating_ip, "UTF-8");
Expand Down
Loading