Skip to content

Instantly share code, notes, and snippets.

@toshvelaga
Last active March 19, 2023 05:21
Show Gist options
  • Save toshvelaga/06b01cba7d712717fc758a97730525f4 to your computer and use it in GitHub Desktop.
Save toshvelaga/06b01cba7d712717fc758a97730525f4 to your computer and use it in GitHub Desktop.
API that checks if user is an individual or a business. If user is a business sends an email notification. python implementation
import requests
import json
url = "https://7a6to3aeyb.execute-api.us-west-1.amazonaws.com/default/notify"
payload = json.dumps({
"email_of_user": "USERS_THAT_REGISTERED_EMAIL_ADDRESS",
"email_of_recepient": "YOUR_EMAIL_ADDRESS_HERE"
})
headers = {
"Content-Type": "application/json"
}
response = requests.post(url, headers=headers, data=payload)
print(response.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment