Infobip API Python client
Running examples
First, setup your username and password in examples/__init__.py. Then, you can run provided examples in examples folder by running:
python example.py deserialize_dr_example # provided argument is <file_name_of_example>
Basic messaging example
First, initialize the messaging client using your username and password:
send_sms_client = send_single_textual_sms(Configuration("https://api.infobip.com", "username", "password"))
Prepare the message:
request = SMSTextualRequest() request.text = "This is an example message" request.to = ["xxxxxxxx", "yyyyyyy"]
Send the message:
response = send_sms_client.execute(request)
Later you can query for the delivery status of the message:
get_delivery_reports_client = get_sent_sms_delivery_reports(Configuration("https://api.infobip.com", "username", "password"))
response = get_delivery_reports_client.execute({"limit": 5})
Messaging with delivery report push to notification URL example
Similar to standard messaging example, but when preparing your message, use SMSAdvancedTextualRequest:
send_sms_client = send_multiple_textual_sms_advanced(Configuration("https://api.infobip.com", "username", "password"))
dest = Destination()
dest.message_id = "message_111"
dest.to = "number1aaa"
message = SMSData()
message.text = "This is an example message."
message.notify_url = "https://test.com/url_for_delivery_reports"
message.destinations = [dest]
dest2 = Destination()
dest2.message_id = "message_222"
dest2.to = "number2bbb"
message2 = SMSData()
message2.text = "This is an example message #2."
message2.notify_url = "https://test.com/url_for_delivery_reports_2"
message2.destinations = [dest2]
request = SMSAdvancedTextualRequest()
request.messages = [message, message2]
response = send_sms_client.execute(request)
When the delivery notification is pushed to your server as a HTTP POST request, you can process the body of the message with the following code:
delivery_status = reports = SMSReportResponse.from_JSON(http_body)
License
This library is licensed under the Apache License, Version 2.0
Metadata
Release files for infobip-api-python-client 0.1.2
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-client-0.1.2.tar.gz | 18.7 kB | Without provenance | Details for infobip-api-python-client-0.1.2.tar.gz |
Release files / infobip-api-python-client-0.1.2.tar.gz
| Download URL | infobip-api-python-client-0.1.2.tar.gz |
|---|---|
| Size | 18.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
66f482cbb7c9107fd959ca3af2e1dbe5f96e2ba6c5ea5a0e83171340d5c010f6
|
|
BLAKE2b-256 checksum How to use checksums |
f4c707c7f59f52149cdca71f4b63f5affc51ab386a858df70e0255971c317822
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for infobip-api-python-client 0.1.2
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.