pyexotel


Namepyexotel JSON
Version 1.0.3 PyPI version JSON
download
home_page
SummaryUnofficial Exotel SDK For Python
upload_time2022-12-25 19:13:55
maintainer
docs_urlNone
authorBijay Nayak
requires_python
license
keywords exotel exotel api exotel sdk pyexotel
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
## 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`:

```python
pip install pyexotel
```

## Exotel Class - Call Methods

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.

```python
from pyexotel import Exotel

dialer = Exotel(api_key="exotel_api_key", api_secret="exotel_api_secret", sid='exotel_sid', domain="exotel_domain")
```
**Parameters**
* api_key (str): Your Exotel `API key`.
* api_secret (str): Your Exotel `API secret`.
* sid (str): Your Exotel `SID`.
* domain (str): Exotel APi Domain ( Singapore cluster is `api.exotel.com` (default) & Mumbai cluster is api.in.exotel.com)
* ccm_domain(str): Exotel CCM Api Domain ( Singapore cluster is `ccm-api.exotel.com` & Mumbai cluster is `ccm-api.in.exotel.com` (Default))


For `Exotel` instance, you can now use the various methods available to interact with the Exotel API. Some 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:

```python
response = dialer.call(agent_number="NumberA", customer_number="numberB", caller_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:

```python
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:

```python
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:

```python
response = dialer.get_phone_info(phone_number)
```

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

## Exotel Class - User Methods

The Exotel class provides several methods for managing users on Exotel's dashboard.

---

### _create\_user_

Creates a new user on Exotel's dashboard.  
**Parameters**

> *   first\_name (str): The first name of the user on Exotel's dashboard.
> *   last\_name (str): The last name of the user on Exotel's dashboard.
> *   user\_email (str): A unique and valid email ID of the user. If not set, the user will not be able to access Exotel's dashboard, but calls can be made via CCM APIs.
> *   user\_phone (str): The phone number of the user. It should be in E.164 format. For VOIP users, this is optional (SIP device will be auto-created).
> *   role (str): The role of the user on Exotel's dashboard. Possible values are "admin", "supervisor", and "user". The default value is "user" (which is an agent with the lowest level of access permissions).

---

### _**get\_user\_details**_

Retrieves the details of a single user, including their associated devices.

**Parameters**

> *   user\_id (str): The ID of the user to retrieve.

**Returns**

> *   (JSON): The response from the API request, containing the details of the user.

**Raises**

> *   (Exception): If an error occurs while making the API request.

---

### _**update\_user**_

Updates an existing user on Exotel's dashboard.

**Parameters**

> *   **user\_id** (str): The ID of the user to update.
> *   **data** (dict): A dictionary containing the following fields to update:

```python
data = {
         "first_name": First Name Of The User,
         "last_name": Last Name Of The User,
         "email": This is allowed only if email wasn't configured during Create User API.,
       }
```

**Returns**

> *   (JSON): The response from the API request, containing the updated details of the user.

**Raises**

> *   (Exception): If an error occurs while making the API request.

---

### _**set\_user\_status**_

Sets the availability status of a user on Exotel's dashboard.

**Parameters**

> *   **user\_id** (str): The ID of the user to update.
> *   **device\_id** (str): The ID of the device associated with the user.
> *   **status** (bool): The user's availability status (True for available, False for unavailable).
> *   **user\_phone** (str): An optional string representing the user's phone number, in E.164 format, to update the device's contact URI.

**Returns**

> *   (JSON): The response from the API request, containing the updated status of the user.

**Raises**

> *   (Exception): If an error occurs while making the API request.

---

### _**delete\_user**_

Deletes a user from Exotel's dashboard.

**Parameters**

> *   **user\_id** (str): The ID of the user to delete.

**Returns**

> *   (JSON): The response from the API request, containing the details of the deleted user.

**Raises**

> *   (Exception): If an error occurs while making the API request.

---

### _**get_all_users**_

Get All Users from Exotel's dashboard'

**Parameters**

>*   **fields (str, optional)**: A comma-separated list of fields to include in the response.
           Valid values are: "devices", "active_call", and "last_login".
           Default value is "devices,active_call,last_login"
**Returns**

> *   (JSON): A list of dictionaries containing information about the users.

**Raises**

> *   (Exception): If an error occurs while making the API request.

---


## 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](https://github.com/devbijay/pyexotel). 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](https://github.com/devbijay/pyexotel). Your contributions are always welcome.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pyexotel",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "exotel,exotel api,exotel sdk,pyexotel",
    "author": "Bijay Nayak",
    "author_email": "<bijay6779@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/be/61/3c514cefe321505794b2cf57e7a131044726215fae5944a51bdf0a73b6d5/pyexotel-1.0.3.tar.gz",
    "platform": null,
    "description": "\n## PyExotel\n\nWelcome 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.\n\n## Installation\n\nTo install pyexotel, use `pip`:\n\n```python\npip install pyexotel\n```\n\n## Exotel Class - Call Methods\n\nTo 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.\n\n```python\nfrom pyexotel import Exotel\n\ndialer = Exotel(api_key=\"exotel_api_key\", api_secret=\"exotel_api_secret\", sid='exotel_sid', domain=\"exotel_domain\")\n```\n**Parameters**\n* api_key (str): Your Exotel `API key`.\n* api_secret (str): Your Exotel `API secret`.\n* sid (str): Your Exotel `SID`.\n* domain (str): Exotel APi Domain ( Singapore cluster is `api.exotel.com` (default) & Mumbai cluster is api.in.exotel.com)\n* ccm_domain(str): Exotel CCM Api Domain ( Singapore cluster is `ccm-api.exotel.com` & Mumbai cluster is `ccm-api.in.exotel.com` (Default))\n\n\nFor `Exotel` instance, you can now use the various methods available to interact with the Exotel API. Some things you can do include:\n\n### Place a Call\n\nTo place a call from one phone number (agent\\_number) to another (customer\\_number), use the call method:\n\n```python\nresponse = dialer.call(agent_number=\"NumberA\", customer_number=\"numberB\", caller_id=\"exotel_callerID\")\n```\n\n### Connect a Call to a Flow\n\nTo connect a call from a customer (`customer_number`) to a specific flow (or applet) using Exotel's API, use the `connect_flow` method:\n\n```python\nresponse = dialer.connect_flow(customer_number, called_id, flow_id)\n```\n\n### Get Call Information\n\nTo get information about a call, such as its timing and recording URL, use the `get_call_info` method:\n\n```python\nexotel.get_call_info(call_sid=\"call_sid\")\n```\n\n### Get Phone Information\n\nTo get information about a phone number, such as its operator name and DND status, use the `get_phone_info` method:\n\n```python\nresponse = dialer.get_phone_info(phone_number)\n```\n\nEach of these methods returns a JSON object containing the response from the Exotel server.\n\n## Exotel Class - User Methods\n\nThe Exotel class provides several methods for managing users on Exotel's dashboard.\n\n---\n\n### _create\\_user_\n\nCreates a new user on Exotel's dashboard.  \n**Parameters**\n\n> *   first\\_name (str): The first name of the user on Exotel's dashboard.\n> *   last\\_name (str): The last name of the user on Exotel's dashboard.\n> *   user\\_email (str): A unique and valid email ID of the user. If not set, the user will not be able to access Exotel's dashboard, but calls can be made via CCM APIs.\n> *   user\\_phone (str): The phone number of the user. It should be in E.164 format. For VOIP users, this is optional (SIP device will be auto-created).\n> *   role (str): The role of the user on Exotel's dashboard. Possible values are \"admin\", \"supervisor\", and \"user\". The default value is \"user\" (which is an agent with the lowest level of access permissions).\n\n---\n\n### _**get\\_user\\_details**_\n\nRetrieves the details of a single user, including their associated devices.\n\n**Parameters**\n\n> *   user\\_id (str): The ID of the user to retrieve.\n\n**Returns**\n\n> *   (JSON): The response from the API request, containing the details of the user.\n\n**Raises**\n\n> *   (Exception): If an error occurs while making the API request.\n\n---\n\n### _**update\\_user**_\n\nUpdates an existing user on Exotel's dashboard.\n\n**Parameters**\n\n> *   **user\\_id** (str): The ID of the user to update.\n> *   **data** (dict): A dictionary containing the following fields to update:\n\n```python\ndata = {\n         \"first_name\": First Name Of The User,\n         \"last_name\": Last Name Of The User,\n         \"email\": This is allowed only if email wasn't configured during Create User API.,\n       }\n```\n\n**Returns**\n\n> *   (JSON): The response from the API request, containing the updated details of the user.\n\n**Raises**\n\n> *   (Exception): If an error occurs while making the API request.\n\n---\n\n### _**set\\_user\\_status**_\n\nSets the availability status of a user on Exotel's dashboard.\n\n**Parameters**\n\n> *   **user\\_id** (str): The ID of the user to update.\n> *   **device\\_id** (str): The ID of the device associated with the user.\n> *   **status** (bool): The user's availability status (True for available, False for unavailable).\n> *   **user\\_phone** (str): An optional string representing the user's phone number, in E.164 format, to update the device's contact URI.\n\n**Returns**\n\n> *   (JSON): The response from the API request, containing the updated status of the user.\n\n**Raises**\n\n> *   (Exception): If an error occurs while making the API request.\n\n---\n\n### _**delete\\_user**_\n\nDeletes a user from Exotel's dashboard.\n\n**Parameters**\n\n> *   **user\\_id** (str): The ID of the user to delete.\n\n**Returns**\n\n> *   (JSON): The response from the API request, containing the details of the deleted user.\n\n**Raises**\n\n> *   (Exception): If an error occurs while making the API request.\n\n---\n\n### _**get_all_users**_\n\nGet All Users from Exotel's dashboard'\n\n**Parameters**\n\n>*   **fields (str, optional)**: A comma-separated list of fields to include in the response.\n           Valid values are: \"devices\", \"active_call\", and \"last_login\".\n           Default value is \"devices,active_call,last_login\"\n**Returns**\n\n> *   (JSON): A list of dictionaries containing information about the users.\n\n**Raises**\n\n> *   (Exception): If an error occurs while making the API request.\n\n---\n\n\n## Note\n\nExotel's V3 API is currently in beta testing and is not yet supported by this SDK.\n\n## Support\n\nIf you have any questions or issues with PyExotel, please feel free to open an issue on the [GitHub repository](https://github.com/devbijay/pyexotel). I will do my best to assist you.\n\n## Contribution\n\nIf you would like to contribute to PyExotel, please feel free to open a pull request on the [GitHub repository](https://github.com/devbijay/pyexotel). Your contributions are always welcome.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Unofficial Exotel SDK For Python",
    "version": "1.0.3",
    "split_keywords": [
        "exotel",
        "exotel api",
        "exotel sdk",
        "pyexotel"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "8cb0a33fb8085e96faeabb7a248e427f",
                "sha256": "3a454498bdc4741aff6a5f8e70b7019f3928af0cce6a1fdf404ba30889246e09"
            },
            "downloads": -1,
            "filename": "pyexotel-1.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8cb0a33fb8085e96faeabb7a248e427f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 8035,
            "upload_time": "2022-12-25T19:13:54",
            "upload_time_iso_8601": "2022-12-25T19:13:54.167646Z",
            "url": "https://files.pythonhosted.org/packages/4f/c6/4d592d9aef369c8472784b7231481b1bfb489b1a873ae1c85aea93c428c6/pyexotel-1.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "d5c06b6944f39b2a249dd6aae84ce483",
                "sha256": "c67a689a6e6f0de8bd79a80304a22c8e5c1d2c4fc277ee114e14e6916fb39c7b"
            },
            "downloads": -1,
            "filename": "pyexotel-1.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "d5c06b6944f39b2a249dd6aae84ce483",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 7562,
            "upload_time": "2022-12-25T19:13:55",
            "upload_time_iso_8601": "2022-12-25T19:13:55.457432Z",
            "url": "https://files.pythonhosted.org/packages/be/61/3c514cefe321505794b2cf57e7a131044726215fae5944a51bdf0a73b6d5/pyexotel-1.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-25 19:13:55",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "pyexotel"
}
        
Elapsed time: 0.02334s