Skip to content

Commit

Permalink
Update to version 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
infobip-ci committed Jun 13, 2024
1 parent e4b51dc commit 95be167
Show file tree
Hide file tree
Showing 381 changed files with 78,433 additions and 16,039 deletions.
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,24 @@ All notable changes to the library will be documented in this file.
The format of the file is based on [Keep a Changelog](http://keepachangelog.com/)
and this library adheres to [Semantic Versioning](http://semver.org/) as mentioned in [README.md][readme] file.

## [ [4.0.0](https://github.com/infobip/infobip-api-python-client/releases/tag/4.0.0) ] - 2024-06-13
🎉 **NEW Major Version of `infobip_api_client`.**

⚠ IMPORTANT NOTE: This release contains breaking changes!

In this release, we updated and modernized the `infobip_api_client` library. It is auto-generated and different from the previous version.

### Added
- Support for [Infobip Calls API](https://www.infobip.com/docs/api/channels/voice/calls)
- Support for [Infobip Click To Call API](https://www.infobip.com/docs/api/channels/voice/click-to-call)
- Support for [Infobip Call Routing API](https://www.infobip.com/docs/api/channels/voice/routing)

## [ [3.0.3](https://github.com/infobip/infobip-api-python-client/releases/tag/3.0.3) ] - 2023-07-03

### General
- Added test infrastructure and a simple test

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

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

[readme]: README.mustache
[readme]: README.mustache
31 changes: 16 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
# Getting Involved

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...
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...

## Submitting an Issue

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].
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].
Include as much information as you have.

Before you submit your issue please do the archive search first, maybe the same question was already answered or is pending.
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.

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

For new feature requests, any sort of bug, anomaly, issue etc. please try to provide us structured information as listed below.
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.
For new feature requests, any sort of bug, anomaly, issue, etc. please try to provide information, as structured below.
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.

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

* **Short TO-THE-POINT Overview** - what seems to be the issue
* **Short TO-THE-POINT Overview** - what seems to be the issue.
* **Description** - more detailed explanation of the issue. The stack trace in cases where it is applicable.
* **Which `infobip_api_client` version(s)** - which library version(s) did you used when the issue occurred.
* **Environment** - is this a problem with all development/testing/production environments or only specific one(s)?
* **Reproducing** - how did it happen? Is it an isolated anomaly, can you reproduce it, what are the steps to reproduce it?
* **Which `infobip_api_client` version(s)** - which library version(s) you used when the issue occurred.
* **Environment** - is this a problem with all development/testing/production environments or only a specific one(s)?
* **Reproducing** - how did it happen? Is it an isolated anomaly, can you recreate it, what are the steps to recreate it?
* **Related Issues** - is there something similar to this issue that has been reported before? If so, please tag that issue(s) as a reference.
* **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.
* **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.

## Pull requests disclaimer
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.
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.
We will not be accepting any pull requests, as the source code within this repository is **auto generated**.
Any change needs to be made by us within the library generation configuration.
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.

[issue-link]: https://github.com/infobip/infobip-api-python-client/issues/new
[issue-link]: https://github.com/infobip/infobip-api-python-client/issues/new
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.
55 changes: 37 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Infobip API Python Client

<img src="https://cdn-web.infobip.com/uploads/2023/01/Infobip-logo.svg" height="93px" alt="Infobip" />

[![Pypi index](https://badgen.net/pypi/v/infobip-api-python-client)](https://pypi.org/project/infobip-api-python-client/)
[![MIT License](https://badgen.net/github/license/infobip/infobip-api-python-client)](https://opensource.org/licenses/MIT)

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

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

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

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

## API documentation

Infobip API Documentation can be found [here][apidocs].
Detailed documentation about Infobip API can be found here. The current version of this library includes this subset of Infobip products:

* [SMS](https://www.infobip.com/docs/api/channels/sms)
* [SMS Messaging](https://www.infobip.com/docs/api/channels/sms/sms-messaging)
* [2FA](https://www.infobip.com/docs/api/channels/sms/2fa)
* [Voice](https://www.infobip.com/docs/api/channels/voice)
* [Calls](https://www.infobip.com/docs/api/channels/voice/calls)
* [Click To Call](https://www.infobip.com/docs/api/channels/voice/click-to-call)
* [Call Routing](https://www.infobip.com/docs/api/channels/voice/routing)

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

Published under [MIT License][license].

Python 3.6 is minimum supported version by this library.
Python 3.7 is minimum supported version by this library.

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

#### Configuration

Let's first set the configuration. For that you will need your specific URL.
Let's first set the configuration. For that you will need your specific URL.
To see your base URL, log in to the [Infobip API Resource][apidocs] hub with your Infobip credentials.
```python
from infobip_api_client.api_client import ApiClient, Configuration

client_config = Configuration(
host="<YOUR_BASE_URL>",
api_key={"APIKeyHeader": "<YOUR_API_KEY>"},
Expand All @@ -65,6 +74,9 @@ Now you are ready use the API.
Here's a basic example of sending the SMS message.

```python
from infobip_api_client.models import SmsAdvancedTextualRequest, SmsTextualMessage, SmsDestination, SmsResponse
from infobip_api_client.api.sms_api import SmsApi

sms_request = SmsAdvancedTextualRequest(
messages=[
SmsTextualMessage(
Expand All @@ -73,21 +85,22 @@ Here's a basic example of sending the SMS message.
to="41793026727",
),
],
_from="InfoSMS",
_from="SMSInfo",
text="This is a dummy SMS message sent using Python library",
)
])

api_instance = SendSmsApi(api_client)
]
)

api_instance = SmsApi(api_client)

api_response: SmsResponse = api_instance.send_sms_message(sms_advanced_textual_request=sms_request)
pprint(api_response)
print(api_response)
```

To make your code more robust send the message in try block and handle the `ApiException` in catch block.
```python
from infobip_api_client.exceptions import ApiException

try:
api_response: SmsResponse = api_instance.send_sms_message(sms_advanced_textual_request=sms_request)
except ApiException as ex:
Expand All @@ -97,7 +110,7 @@ To make your code more robust send the message in try block and handle the `ApiE
In case of failure you can inspect the `ApiException` for more information.
```python
try:
api_response: SmsResponse = api_instance.send_sms_message(sms_advanced_binary_request=sms_advanced_binary_request)
api_response: SmsResponse = api_instance.send_sms_message(sms_advanced_textual_request=sms_request)
except ApiException as ex:
print("Error occurred while trying to send SMS message.")
print("Error status: %s\n" % ex.status)
Expand All @@ -120,12 +133,14 @@ e.g. `https://{yourDomain}/delivery-reports`
Example of webhook implementation using Flask:

```python
from infobip_api_client.models import SmsDeliveryResult

@app.route("/api/delivery-reports", methods=["POST"])
def delivery_report():
delivery_result = SmsDeliveryResult(
delivery_results = SmsDeliveryResult(
results=request.json["results"]
)

for result in delivery_results.results:
print("message {0} sent at {1}".format(result.message_id, result.sent_at))
```
Expand All @@ -144,10 +159,12 @@ Each request will return a batch of delivery reports. Please be aware that these
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.

```python
from infobip_api_client.models import SmsPreviewRequest

sms_preview_request = SmsPreviewRequest(
text="Let's see how many characters will remain unused in this message."
)

api_response = api_instance.preview_sms_message(sms_preview_request=sms_preview_request)
```

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

```python
from infobip_api_client.models import SmsInboundMessageResult

@app.route("/api/incoming-sms", methods=["POST"])
def incoming_sms():
message_results = SmsInboundMessageResult(
message_count=request.json["message_count"],
pending_message_count=request.json["pending_message_count"],
results=request.json["results"]
)

for result in message_results.results:
print("message text: {0}".format(result.clean_text))

```
#### Two-Factor Authentication (2FA)
For 2FA quick start guide please check [these examples](two-factor-authentication.md).
Expand All @@ -184,4 +203,4 @@ If it's something that requires our imminent attention feel free to contact us @
[signup]: https://www.infobip.com/signup
[semver]: https://semver.org
[license]: LICENSE
[contributing]: CONTRIBUTING.md
[contributing]: CONTRIBUTING.md
Loading

0 comments on commit 95be167

Please sign in to comment.