Callhub-python-wrapper

Latest version: v1.2.3

Safety actively analyzes 613777 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

1.2.0

Important change made to `add_dnc`: In the case of a failed API request (like a 502 error), the wrapper will attempt to retry the request.

v.1.1.0
Added new functionality to handle errors

* `add_dnc` and `remove` dnc now return a list of failed requests instead of throwing an exception and bringing down the whole program
* minor bug fixes

1.0.0

**A change that breaks backwards compatibility has been made to support a major change to CallHub's API.**

Users must now specify an API domain when creating a CallHub instance.

E.G. `CallHub("https://api-na1.callhub.io", "api_key"="123456789ABCDEF)`

Previous versions of this wrapper assumed all users accessed the CallHub API at https://api.callhub.io.

**Rationale**

Recently, I noticed that newly created CallHub accounts may provide different api endpoints to users than https://api.callhub.io. For example, a different endpoint I saw was https://api-na1.callhub.io.

This presents a major problem for this wrapper because if you try to perform api functions on https://api.callhub.io with an api key that is supposed to be used on a different endpoint, some calls will work, and other calls will silently fail (like bulk-create).

Automatic detection of the correct endpoint is tricky, if not impossible, so the only solution is to explicitly require users to specify the endpoint that CallHub provides them on their settings->api page. Unfortunately, this breaks backwards compatibility, but it's worth it to avoid potentially confusing silent failures.

0.4.0

Added new functionality relating to CallHub webhooks:

* `create_webhook` creates a webhook with a given target and event (default event is cc.notes, which is when an agent completes a call)
* `get_webhooks` returns all webhooks for the callhub account
* `delete_webhook` deletes a given webhook (by id)

0.3.0

Added new functionality relating to CallHub campaigns and phonebooks

* `get_campaigns` returns list of campaigns. Prerequisite for implementing ability to export campaigns
* `create_phonebook` creates a phonebook with a given name and returns the id of the newly created phonebook

0.2.1

Added new functionality relating to CallHub do-not-contact lists:
* `add_dnc_list`: Create a DNC list with a given name. Returns the ID of the new list.
* `remove_dnc_list`: Remove a DNC list with a given ID.
* `add_dnc`: Add a list of phone numbers to a given DNC list. Returns a dict containing information about the new DNC record.
* `remove_dnc`: Remove a list of phone numbers from a given DNC list. If a DNC list is not specified, remove phone numbers from all existing dnc lists.

0.1.2

* Tweak: Check if API key valid upon class instantiation. Raise ``KeyError`` if bad API key, ``RuntimeError`` if CallHub API behaving unexpectedly
* Tweak: ``__repr__`` returns ``<CallHub admin: adminemailexample.com>`` instead of less useful information.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.