Skip to content

Commit 95be167

Browse files
author
infobip-ci
committed
Update to version 4.0.0
1 parent e4b51dc commit 95be167

File tree

381 files changed

+78433
-16039
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

381 files changed

+78433
-16039
lines changed

CHANGELOG.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,24 @@ All notable changes to the library will be documented in this file.
55
The format of the file is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this library adheres to [Semantic Versioning](http://semver.org/) as mentioned in [README.md][readme] file.
77

8+
## [ [4.0.0](https://github.com/infobip/infobip-api-python-client/releases/tag/4.0.0) ] - 2024-06-13
9+
🎉 **NEW Major Version of `infobip_api_client`.**
10+
11+
⚠ IMPORTANT NOTE: This release contains breaking changes!
12+
13+
In this release, we updated and modernized the `infobip_api_client` library. It is auto-generated and different from the previous version.
14+
15+
### Added
16+
- Support for [Infobip Calls API](https://www.infobip.com/docs/api/channels/voice/calls)
17+
- Support for [Infobip Click To Call API](https://www.infobip.com/docs/api/channels/voice/click-to-call)
18+
- Support for [Infobip Call Routing API](https://www.infobip.com/docs/api/channels/voice/routing)
19+
820
## [ [3.0.3](https://github.com/infobip/infobip-api-python-client/releases/tag/3.0.3) ] - 2023-07-03
921

1022
### General
1123
- Added test infrastructure and a simple test
1224

13-
## [ [3.0.2] ] - 2023-07-03
25+
## [ [3.0.2](https://github.com/infobip/infobip-api-python-client/releases/tag/3.0.2) ] - 2023-07-03
1426

1527
### Fixed
1628
- ApiAttributeError when deserializing response that contains unknown fields
@@ -40,4 +52,4 @@ In this release, we updated and modernized the `infobip_api_client` library. It
4052
- Support for [Infobip SMS Tracking API](https://www.infobip.com/docs/sms/tracking) methods (to be included back in one of the next releases)
4153
- `examples` directory
4254

43-
[readme]: README.mustache
55+
[readme]: README.mustache

CONTRIBUTING.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
11
# Getting Involved
22

3-
Thanks for your interest in the project, we'd love to have you involved! Check out the sections below to find out more about what to do next...
3+
Thanks for your interest in the project, we'd love to have you involved! Check out sections below to find out more about what to do next...
44

55
## Submitting an Issue
66

7-
If you've seen something that is or might seem like a bug or a mistake in the documentation, or you simply have a suggestion for a new feature, please go ahead and open us [an issue][issue-link].
7+
If you've seen something that is or may seem like a bug or a mistake in documentation, or you simply have a suggestion for a new feature, please go ahead and open [an issue][issue-link].
88
Include as much information as you have.
99

10-
Before you submit your issue please do the archive search first, maybe the same question was already answered or is pending.
10+
Before you submit your issue, please do the archive search first, as there may be a similar question that's already been answered or is pending a response.
1111

12-
If you did not find a related issue among the already asked, feel free to open a new issue.
12+
If you haven't found any related issues among the already asked, feel free to open a new one.
1313

14-
For new feature requests, any sort of bug, anomaly, issue etc. please try to provide us structured information as listed below.
15-
You don't have to follow it to the letter but having it structured like below may save us a lot of time to pinpoint and fix the issue quicker.
14+
For new feature requests, any sort of bug, anomaly, issue, etc. please try to provide information, as structured below.
15+
You don't have to follow it to the letter, but having it structured like below may save us a lot of time to pinpoint and fix the issue quicker.
1616

1717
### New issue structure (bugs, anomalies, improvements...)
18-
Providing the following information will increase the chances of dealing with your issue sooner:
18+
Providing the following information will increase the chances of your issue being dealt with quickly:
1919

20-
* **Short TO-THE-POINT Overview** - what seems to be the issue
20+
* **Short TO-THE-POINT Overview** - what seems to be the issue.
2121
* **Description** - more detailed explanation of the issue. The stack trace in cases where it is applicable.
22-
* **Which `infobip_api_client` version(s)** - which library version(s) did you used when the issue occurred.
23-
* **Environment** - is this a problem with all development/testing/production environments or only specific one(s)?
24-
* **Reproducing** - how did it happen? Is it an isolated anomaly, can you reproduce it, what are the steps to reproduce it?
22+
* **Which `infobip_api_client` version(s)** - which library version(s) you used when the issue occurred.
23+
* **Environment** - is this a problem with all development/testing/production environments or only a specific one(s)?
24+
* **Reproducing** - how did it happen? Is it an isolated anomaly, can you recreate it, what are the steps to recreate it?
2525
* **Related Issues** - is there something similar to this issue that has been reported before? If so, please tag that issue(s) as a reference.
26-
* **Suggest a Fix** - the library code is generated, but perhaps you can provide us your code sample as a fix to the part of the code that is causing the bug.
26+
* **Suggest a Fix** - this code is auto generated, but perhaps you can provide us with your code sample as a fix to the part of the code that is causing the bug.
2727

2828
## Pull requests disclaimer
29-
We will not be accepting pull requests. However, because source code within this repository is **generated**, hence the changes will need to be made by us within library generation configuration.
30-
Having said that, we still fully do encourage you to submit an issue since that will help us track it and keep you up-to-date.
29+
We will not be accepting any pull requests, as the source code within this repository is **auto generated**.
30+
Any change needs to be made by us within the library generation configuration.
31+
Having said that, we still fully encourage you to submit an issue, since that will help us track it and keep you up to date.
3132

32-
[issue-link]: https://github.com/infobip/infobip-api-python-client/issues/new
33+
[issue-link]: https://github.com/infobip/infobip-api-python-client/issues/new

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
THE SOFTWARE.
21+
THE SOFTWARE.

README.md

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Infobip API Python Client
22

3+
<img src="https://cdn-web.infobip.com/uploads/2023/01/Infobip-logo.svg" height="93px" alt="Infobip" />
4+
35
[![Pypi index](https://badgen.net/pypi/v/infobip-api-python-client)](https://pypi.org/project/infobip-api-python-client/)
46
[![MIT License](https://badgen.net/github/license/infobip/infobip-api-python-client)](https://opensource.org/licenses/MIT)
57

@@ -8,7 +10,6 @@ To use the package you'll need an Infobip account. If you don't already have one
810

911
We use [OpenAPI Generator](https://openapi-generator.tech/) to generate the package code from the OpenAPI specification.
1012

11-
<img src="https://udesigncss.com/wp-content/uploads/2020/01/Infobip-logo-transparent.png" height="124px" alt="Infobip" />
1213

1314
#### Table of contents:
1415
* [API documentation](#documentation)
@@ -19,14 +20,22 @@ We use [OpenAPI Generator](https://openapi-generator.tech/) to generate the pack
1920

2021
## API documentation
2122

22-
Infobip API Documentation can be found [here][apidocs].
23+
Detailed documentation about Infobip API can be found here. The current version of this library includes this subset of Infobip products:
24+
25+
* [SMS](https://www.infobip.com/docs/api/channels/sms)
26+
* [SMS Messaging](https://www.infobip.com/docs/api/channels/sms/sms-messaging)
27+
* [2FA](https://www.infobip.com/docs/api/channels/sms/2fa)
28+
* [Voice](https://www.infobip.com/docs/api/channels/voice)
29+
* [Calls](https://www.infobip.com/docs/api/channels/voice/calls)
30+
* [Click To Call](https://www.infobip.com/docs/api/channels/voice/click-to-call)
31+
* [Call Routing](https://www.infobip.com/docs/api/channels/voice/routing)
2332

2433
## General Info
2534
For `infobip-api-python-client` versioning we use [Semantic Versioning][semver] scheme.
2635

2736
Published under [MIT License][license].
2837

29-
Python 3.6 is minimum supported version by this library.
38+
Python 3.7 is minimum supported version by this library.
3039

3140
## Installation
3241
Pull the library by using the following command:
@@ -40,11 +49,11 @@ Before initializing the client first thing you need to do is to set configuratio
4049

4150
#### Configuration
4251

43-
Let's first set the configuration. For that you will need your specific URL.
52+
Let's first set the configuration. For that you will need your specific URL.
4453
To see your base URL, log in to the [Infobip API Resource][apidocs] hub with your Infobip credentials.
4554
```python
4655
from infobip_api_client.api_client import ApiClient, Configuration
47-
56+
4857
client_config = Configuration(
4958
host="<YOUR_BASE_URL>",
5059
api_key={"APIKeyHeader": "<YOUR_API_KEY>"},
@@ -65,6 +74,9 @@ Now you are ready use the API.
6574
Here's a basic example of sending the SMS message.
6675

6776
```python
77+
from infobip_api_client.models import SmsAdvancedTextualRequest, SmsTextualMessage, SmsDestination, SmsResponse
78+
from infobip_api_client.api.sms_api import SmsApi
79+
6880
sms_request = SmsAdvancedTextualRequest(
6981
messages=[
7082
SmsTextualMessage(
@@ -73,21 +85,22 @@ Here's a basic example of sending the SMS message.
7385
to="41793026727",
7486
),
7587
],
76-
_from="InfoSMS",
88+
_from="SMSInfo",
7789
text="This is a dummy SMS message sent using Python library",
7890
)
79-
])
80-
81-
api_instance = SendSmsApi(api_client)
91+
]
92+
)
93+
94+
api_instance = SmsApi(api_client)
8295

8396
api_response: SmsResponse = api_instance.send_sms_message(sms_advanced_textual_request=sms_request)
84-
pprint(api_response)
97+
print(api_response)
8598
```
8699

87100
To make your code more robust send the message in try block and handle the `ApiException` in catch block.
88101
```python
89102
from infobip_api_client.exceptions import ApiException
90-
103+
91104
try:
92105
api_response: SmsResponse = api_instance.send_sms_message(sms_advanced_textual_request=sms_request)
93106
except ApiException as ex:
@@ -97,7 +110,7 @@ To make your code more robust send the message in try block and handle the `ApiE
97110
In case of failure you can inspect the `ApiException` for more information.
98111
```python
99112
try:
100-
api_response: SmsResponse = api_instance.send_sms_message(sms_advanced_binary_request=sms_advanced_binary_request)
113+
api_response: SmsResponse = api_instance.send_sms_message(sms_advanced_textual_request=sms_request)
101114
except ApiException as ex:
102115
print("Error occurred while trying to send SMS message.")
103116
print("Error status: %s\n" % ex.status)
@@ -120,12 +133,14 @@ e.g. `https://{yourDomain}/delivery-reports`
120133
Example of webhook implementation using Flask:
121134

122135
```python
136+
from infobip_api_client.models import SmsDeliveryResult
137+
123138
@app.route("/api/delivery-reports", methods=["POST"])
124139
def delivery_report():
125-
delivery_result = SmsDeliveryResult(
140+
delivery_results = SmsDeliveryResult(
126141
results=request.json["results"]
127142
)
128-
143+
129144
for result in delivery_results.results:
130145
print("message {0} sent at {1}".format(result.message_id, result.sent_at))
131146
```
@@ -144,10 +159,12 @@ Each request will return a batch of delivery reports. Please be aware that these
144159
Infobip API supports Unicode characters and automatically detects encoding. Unicode and non-standard GSM characters use additional space, avoid unpleasant surprises and check how different message configurations will affect your message text, number of characters and message parts.
145160

146161
```python
162+
from infobip_api_client.models import SmsPreviewRequest
163+
147164
sms_preview_request = SmsPreviewRequest(
148165
text="Let's see how many characters will remain unused in this message."
149166
)
150-
167+
151168
api_response = api_instance.preview_sms_message(sms_preview_request=sms_preview_request)
152169
```
153170

@@ -158,17 +175,19 @@ e.g. `https://{yourDomain}/incoming-sms`.
158175
Example of webhook implementation using Flask:
159176

160177
```python
178+
from infobip_api_client.models import SmsInboundMessageResult
179+
161180
@app.route("/api/incoming-sms", methods=["POST"])
162181
def incoming_sms():
163182
message_results = SmsInboundMessageResult(
164183
message_count=request.json["message_count"],
165184
pending_message_count=request.json["pending_message_count"],
166185
results=request.json["results"]
167186
)
168-
187+
169188
for result in message_results.results:
170189
print("message text: {0}".format(result.clean_text))
171-
190+
172191
```
173192
#### Two-Factor Authentication (2FA)
174193
For 2FA quick start guide please check [these examples](two-factor-authentication.md).
@@ -184,4 +203,4 @@ If it's something that requires our imminent attention feel free to contact us @
184203
[signup]: https://www.infobip.com/signup
185204
[semver]: https://semver.org
186205
[license]: LICENSE
187-
[contributing]: CONTRIBUTING.md
206+
[contributing]: CONTRIBUTING.md

0 commit comments

Comments
 (0)