Skip to main content

Unofficial Exotel SDK For Python

Project description

PyExotel

Welcome to PyExotel, an unofficial Python package for interacting with Exotel's API. With PyExotel, you can easily make phone calls, manage campaigns, and gather information about calls and phone numbers using your Exotel API credentials.

Installation

To install pyexotel, use pip:

pip install pyexotel

Usage

To use PyExotel, you will first need to create an instance of the Exotel class with your Exotel API key, API secret, SID, and domain. You can find these credentials in the Exotel Dashboard.

from pyexotel import Exotel

dialer = Exotel(api_key="exotel_api_key", api_secret="exotel_api_secret", sid='exotel_sid', domain="exotel_domain")

With the Exotel instance, you can now use the various methods available to interact with the Exotel API. Some of the things you can do include:

Place a Call

To place a call from one phone number (agent_number) to another (customer_number), use the call method:

response = dialer.call(agent_number="NumberA", customer_number="numberB", called_id="exotel_callerID")

Connect a Call to a Flow

To connect a call from a customer (customer_number) to a specific flow (or applet) using Exotel's API, use the connect_flow method:

response = dialer.connect_flow(customer_number, called_id, flow_id)

Get Call Information

To get information about a call, such as its timing and recording URL, use the get_call_info method:

exotel.get_call_info(call_sid="call_sid")

Get Phone Information

To get information about a phone number, such as its operator name and DND status, use the get_phone_info method:

response = dialer.get_call_info(call_sid)

Each of these methods returns a JSON object containing the response from the Exotel server.

Error Handling

In case of any errors, the Exotel methods will raise an exception. It is recommended to handle these exceptions in your code to gracefully handle any errors that may occur.

For example:

try:
    response = exotel.call(agent_number="agent_number", customer_number="customer_number", caller_id="caller_id")
except Exception as e:
    print(f"An error occurred: {e}")

Note

Exotel's V3 API is currently in beta testing and is not yet supported by this SDK.

Support

If you have any questions or issues with PyExotel, please feel free to open an issue on the GitHub repository. I will do my best to assist you.

Contribution

If you would like to contribute to PyExotel, please feel free to open a pull request on the GitHub repository. Your contributions are always welcome.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyexotel-1.0.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

pyexotel-1.0.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file pyexotel-1.0.0.tar.gz.

File metadata

  • Download URL: pyexotel-1.0.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pyexotel-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3666c8e326221baf4613d162588b81fe12736b0052c27f9a0b992b2f9e6474fe
MD5 38e69fc30b439ef42cf0c86c242355ef
BLAKE2b-256 91e50c5e2ba90efe243fb46bb6e8b3e452cd0d193e4146339f9ceb7c58936ed1

See more details on using hashes here.

Provenance

File details

Details for the file pyexotel-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyexotel-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pyexotel-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ea645cf9a917fc99c66c713d1a1809332cb86191ed3eb77a27db6025b26b8588
MD5 4a1f2ccbee6f67a5833f9e03fbada402
BLAKE2b-256 39825bb219fb20bc722970e8b99e498612d83bd11f5afb2799570caf45dc84aa

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page