Giter Site home page Giter Site logo

infobip-api-python-sdk's Introduction

Infobip API Python SDK

Version Python Workflow Release Licence

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.

infobip-api-python-sdk's People

Contributors

dlozina avatar eli-miriam avatar infobipdev avatar kilicluka avatar snyk-bot avatar strosek avatar ukmadlz avatar vandelay-art avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

infobip-api-python-sdk's Issues

Consider relaxing dependency requirements

Hi, could you consider relaxing the fixed dependency requirements?

I'm trying to build an airbyte source connector for infobip, but I run into the following problem:

ERROR: Cannot install -r requirements.txt (line 1), connector-acceptance-test and source-infobip because these package versions have conflicting dependencies.

The conflict is caused by:
    connector-acceptance-test 0.0.0 depends on pydantic~=1.6
    airbyte-cdk 0.2.0 depends on pydantic~=1.9.2
    infobip-api-python-sdk 5.0.0 depends on pydantic==1.9.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.