Snippets

ESTI design registration and verification requests for Authy endpoint

Created by Robert Poz last modified
# FOR LOGGED IN UESR

# TOKEN request - country_code, email, cellphone params might be passed and will override existing customer data (I'm not sure if we need this functionality)

# This request will use customer stored data for verfication
curl --header "Authorization: Basic MjEzMDcwNjQzMyRjZTY3ZjUzZTE5NzI4MGI1NDM1NjY0ODM1OGJlZDdjOA==" http://watch.test.russiantvcompany.com/app-gw/customer/authy/token -X POST -d ''

# This request will override all country_code, email, cellphone customer params 
curl --header "Authorization: Basic MjEzMDcwNjQzMyRjZTY3ZjUzZTE5NzI4MGI1NDM1NjY0ODM1OGJlZDdjOA==" http://watch.test.russiantvcompany.com/app-gw/customer/authy/token -X POST -d "country_code=1&cellphone=8608697941&email=test.example.com"

# This request will override customer's phone attribute only and use default country code (=1) and customer's email
curl --header "Authorization: Basic MjEzMDcwNjQzMyRjZTY3ZjUzZTE5NzI4MGI1NDM1NjY0ODM1OGJlZDdjOA==" http://watch.test.russiantvcompany.com/app-gw/customer/authy/token -X POST -d "cellphone=8608697941"

# Example responses:
# {"success":true,"errors":[]}

# VERIFICATION REQUEST

curl --header "Authorization: Basic MjEzMDcwNjQzMyRjZTY3ZjUzZTE5NzI4MGI1NDM1NjY0ODM1OGJlZDdjOA==" http://watch.test.russiantvcompany.com/app-gw/customer/authy/verify -X POST -d "token=3234836"

# Example responses:
# {"success":false,"errors":["Token is invalid. Token was used recently"]}
# {"success":true,"errors":[]}

# FOR NON-LOGGED-IN USER

# TOKEN request - pass all params as below (country_code is optional with default =1)

curl --header "Authorization: Basic MjEzMDcwNjQzMyRjZTY3ZjUzZTE5NzI4MGI1NDM1NjY0ODM1OGJlZDdjOA==" http://watch.test.russiantvcompany.com/app-gw/authy/token -X POST -d "country_code=1&cellphone=8608697941&email=test.example.com"
# TOKEN response
# {"success":true,"errors":[],"authy_id":121968815} 

# so alternatively it's enough:

curl --header "Authorization: Basic MjEzMDcwNjQzMyRjZTY3ZjUzZTE5NzI4MGI1NDM1NjY0ODM1OGJlZDdjOA==" http://watch.test.russiantvcompany.com/app-gw/authy/token -X POST -d "cellphone=8608697941&email=test@example.com"
# TOKEN response
# {"success":true,"errors":[],"authy_id":121968815} 


# VERIFY request - pass id (return authy_uid from token request) and verification token 
curl --header "Authorization: Basic MjEzMDcwNjQzMyRjZTY3ZjUzZTE5NzI4MGI1NDM1NjY0ODM1OGJlZDdjOA==" http://watch.test.russiantvcompany.com/app-gw/authy/verify -X POST -d "id=121968815&token=6337895"

# VERFIY response
# {"success":true,"errors":[]}
# or: {"success":false,"errors":["Token is invalid"]}

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.