Infobip API Python SDK
Client SDK to use the Infobip API with Python.
This package enables you to use multiple Infobip communication channels, like SMS, MMS, WhatsApp, Email, etc.
📡 Supported APIs
The following communication channels are supported:
The following platform management APIs are supported:
More APIs to be added in the near future.
🔐 Authentication
Currently, infobip-api-python-sdk only supports API Key authentication, and the key needs to be passed during client creation. This will most likely change with future versions, once more authentication methods are included.
📦 Installation
To install infobip SDK you will need to run:
pip install infobip-api-python-sdk
Details of the package can be found in the PyPI page.
🚀 Usage
Code Example
To use the package you'll need an Infobip account. If you don't already have one, you can create a free trial account here.
In this example, we will show how to send a WhatsApp text message. Other channels can be used in a similar way. The first step is to import the necessary channel, in this case WhatsApp channel.
from infobip_channels.whatsapp.channel import WhatsAppChannel
Now you can create instance of WhatsAppChannel with your base_url and api_key.
c = WhatsAppChannel.from_auth_params({
"base_url": "<your_base_url>",
"api_key": "<your_api_key>"
})
Alternatively, you can create the instance from the environment, having the IB_BASE_URL and IB_API_KEY variables
set, like this:
c = WhatsAppChannel.from_env()
After that you can access all the methods from WhatsAppChannel.
To send text message you can use send_text_message method and add correct payload:
response = c.send_text_message(
{
"from": "<WhatsApp sender number from your Infobib account>",
"to": "<Number that will receive WhatsApp message>",
"messageId": "a28dd97c-1ffb-4fcf-99f1-0b557ed381da",
"content": {
"text": "Some text"
},
"callbackData": "Callback data",
"notifyUrl": "https://www.example.com/whatsapp"
}
)
Samples
We are adding samples in the samples folder, which you can use as a reference on how to use the SDK with real payloads.
🗒️ Notes
For infobip-api-python-sdk versioning we use
Semantic Versioning scheme.
Python 3.6 is the minimum supported version by this library.
🧡 Want to help and improve this open-source SDK?
Check out our contributing guide and code of conduct.
⚖️ License
This library is distributed under the MIT license found in the License.
Metadata
Release files for infobip-api-python-sdk 5.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| infobip-api-python-sdk-5.0.1.tar.gz | 43.4 kB | Without provenance | Details for infobip-api-python-sdk-5.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| infobip_api_python_sdk-5.0.1-py3-none-any.whl | Python 3 | none | any | Details for infobip_api_python_sdk-5.0.1-py3-none-any.whl |
Total release size: 139.8 kB
Release files / infobip-api-python-sdk-5.0.1.tar.gz
| Download URL | infobip-api-python-sdk-5.0.1.tar.gz |
|---|---|
| Size | 43.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
579a68f249de02ae11ba098b484f0064d7321b010c94fa6278ed00c766c1ff3a
|
|
BLAKE2b-256 checksum How to use checksums |
bd012e6366f85efa4c955ce354a3a40ba216bc27d64426bd4b55cdb60ade4e64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.6
|
Release files / infobip_api_python_sdk-5.0.1-py3-none-any.whl
| Download URL | infobip_api_python_sdk-5.0.1-py3-none-any.whl |
|---|---|
| Size | 96.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
40a1ec4bf7328cb39853f4e9e1987f98a44511f4408c385637982c5cafe4ac43
|
|
BLAKE2b-256 checksum How to use checksums |
90370f71ae5a2e8561b46ef1f3c553125e60986882d713e4f7a88b8141bb51c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.6
|
Security for infobip-api-python-sdk 5.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.