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
3 changes: 3 additions & 0 deletions RELEASE
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2.1.4
- Added status method to AppVerifyClient

2.1.3
- Added AppVerifyClient

Expand Down
6 changes: 6 additions & 0 deletions examples/app_verify/1_initiate_and_finalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@

verify = AppVerifyClient(customer_id, api_key)

# Initiate App Verify Call
initiate_response = verify.initiate(phone_number)
print("initiate response: {}\n".format(initiate_response.json))

# Get intermediate call status to trigger a failure or retry quickly on the mobile app
reference_id = initiate_response.json['reference_id']
status_response = verify.status(reference_id)
print("initiate response: {}\n".format(status_response.json))

# Finalize App Verify Transaction
verify_code = raw_input("Please enter the verification code from the caller id: ")
finalize_response = verify.finalize(reference_id, verify_code=verify_code)
print("\nfinalize response: {}\n".format(finalize_response.json))
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@

verify = AppVerifyClient(customer_id, api_key)

# Initiate App Verify Call
verify_code = raw_input("Please enter the verification code for initiate: ")
initiate_response = verify.initiate(phone_number, verify_code=verify_code)
print("initiate response: {}\n".format(initiate_response.json))

# Finalize App Verify transaction
reference_id = initiate_response.json['reference_id']
verify_code = raw_input("Please enter the verification code from the caller id: ")
finalize_response = verify.finalize(reference_id, verify_code=verify_code)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages

version = "2.1.3"
version = "2.1.4"

try:
with open("README") as f:
Expand Down
11 changes: 11 additions & 0 deletions telesignenterprise/appverify.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

APP_VERIFY_INITIATE_RESOURCE = '/v1/verify/auto/voice/initiate'
APP_VERIFY_FINALIZE_RESOURCE = '/v1/verify/auto/voice/finalize'
APP_VERIFY_STATUS_RESOURCE = '/v1/verify/auto/voice/{}'


class AppVerifyClient(_AppVerifyClient):
Expand Down Expand Up @@ -39,3 +40,13 @@ def finalize(self, reference_id, **params):
return self.post(APP_VERIFY_FINALIZE_RESOURCE,
reference_id=reference_id,
**params)

def status(self, reference_id, **params):
"""
TeleSign looks up the status for the verification call in the
Initiate request to determine status of the AV call, including
intermediate call status such as call failed, or retry.

See https://enterprise.telesign.com/docs/app-verify-api for detailed API documentation.
"""
return self.get(APP_VERIFY_STATUS_RESOURCE.format(reference_id), **params)