-
-
Save aaronbassett/3aaf6b98312493826939c245d0d7e89e to your computer and use it in GitHub Desktop.
Example code using the Nexmo Voice API and Environment Variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import nexmo | |
client = nexmo.Client( | |
application_id=os.getenv("NEXMO_APPLICATION_ID"), | |
private_key=os.getenv("NEXMO_PRIVATE_KEY", "./private.key"), | |
) | |
response = client.create_call( | |
{ | |
"to": [{"type": "phone", "number": os.getenv("TO_NUMBER")}], | |
"from": {"type": "phone", "number": os.getenv("NEXMO_NUMBER")}, | |
"answer_url": [f"{os.getenv('VAPI_URL')}/answer"], | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment