twilio
library and appropriate Twilio credentials, which can be obtained from here.
Name | Type | Default | Description |
---|---|---|---|
account_sid | Optional[str] | None | Twilio Account SID for authentication. |
auth_token | Optional[str] | None | Twilio Auth Token for authentication. |
api_key | Optional[str] | None | Twilio API Key for alternative authentication. |
api_secret | Optional[str] | None | Twilio API Secret for alternative authentication. |
region | Optional[str] | None | Optional Twilio region (e.g., au1 ). |
edge | Optional[str] | None | Optional Twilio edge location (e.g., sydney ). |
debug | bool | False | Enable debug logging for troubleshooting. |
Function | Description |
---|---|
send_sms | Sends an SMS to a recipient. Takes recipient phone number, sender number (Twilio), and message body. Returns message SID if successful or error message if failed. |
get_call_details | Retrieves details of a call using its SID. Takes the call SID and returns a dictionary with call details (e.g., status, duration). |
list_messages | Lists recent SMS messages. Takes a limit for the number of messages to return (default 20). Returns a list of message details (e.g., SID, sender, recipient, body, status). |