Skip to content

Example repository that shows how to accept incoming requests from Twilio and tokenize sensitive data (card number) from user input using Basis Theory Proxy.

Notifications You must be signed in to change notification settings

Basis-Theory-Labs/twiml-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TwiML Example

This repository shows how to accept incoming requests from Twilio and tokenize sensitive data (card number) from user input using Basis Theory Proxy.

  1. TwiML will make a request via Webhook:
curl "https://api.basistheory.com/proxy?bt-proxy-key={{inbound_proxy_key}}" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -X "POST" \
  -d 'AccountSid=....&Digits=4242424242424242&...'
  1. Basis Theory Proxy will tokenize the card number and call the destination URL:
curl "https://echo.basistheory.com/anything" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -X "POST" \
  -d 'AccountSid=....&Digits=26818785-547b-4b28-b0fa-531377e99f4e&...'
  1. Basis Theory Proxy will return the destination URL response to Twilio.

Run this POC

Create a new Management Application with full application and proxy permissions.

Paste the API key to a new secret.tfvars file at this repository root:

management_api_key = "key_W8wA8CmcbwXxJsomxeWHVy"

Initialize Terraform:

terraform init

And run Terraform to provision all the required resources:

terraform apply -var-file=secret.tfvars

Use the inbound_proxy_key Terraform output to generate the TwiML Webhook URL: https://api.basistheory.com/proxy?bt-proxy-key={{inbound_proxy_key}}.

About

Example repository that shows how to accept incoming requests from Twilio and tokenize sensitive data (card number) from user input using Basis Theory Proxy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published