Skip to main content

MessageBird's REST API for Python

This repository contains the open source Python client for MessageBird's REST API. Documentation can be found at: https://developers.messagebird.com/.

Requirements

  • Sign up for a free MessageBird account
  • Create a new access key in the developers sections
  • An application written in Python >3.8

Installation

The easiest way to install the messagebird package is either via pip:

$ pip install messagebird

or manually by downloading the source and run the setup.py script:

$ python setup.py install

Examples

We have put some self-explanatory examples in the examples directory, but here is a quick example on how to get started. Assuming the installation was successful, you can import the messagebird package like this:

import messagebird

Then, create an instance of messagebird.Client:

client = messagebird.Client('YOUR_ACCESS_KEY')

Now you can query the API for information or send a request. For example, if we want to request our balance information you'd do something like this:

try:
  # Fetch the Balance object.
  balance = client.balance()

  # Print the object information.
  print('Your balance:\n')
  print('  amount  : %d' % balance.amount)
  print('  type    : %s' % balance.type)
  print('  payment : %s\n' % balance.payment)

except messagebird.client.ErrorException as e:
  print('Error:\n')

  for error in e.errors:
    print('  code        : %d' % error.code)
    print('  description : %s' % error.description)
    print('  parameter   : %s\n' % error.parameter)

This will give you something like:

$ python example.py
Your balance:

  amount  : 9 
  type    : credits
  payment : prepaid

Please see the other examples for a complete overview of all the available API calls.

To run examples with arguments, try:

$ python ./examples/voice_create_webhook.py --accessKey accessKeyWhichNotExist --url https://example.com --title HELLO_WEBHOOK --token HELLO_TOKEN

Documentation

Complete documentation, instructions, and examples are available at: https://developers.messagebird.com/.

License

The MessageBird REST Client for Python is licensed under The BSD 2-Clause License. Copyright (c) 2022, MessageBird

Metadata

Release files for messagebird 2.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for messagebird 2.2.0
File Size Uploaded
messagebird-2.2.0.tar.gz 30.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for messagebird 2.2.0
File Interpreter ABI Platform
messagebird-2.2.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 58.8 kB

Release files / messagebird-2.2.0.tar.gz

Download URL messagebird-2.2.0.tar.gz
Size 30.8 kB
Tags Source
SHA-256 checksum
How to use checksums
71e80425f6027630b4c66d40c70f75ef8516c9d942e1b003f7d488c69e23ad79
BLAKE2b-256 checksum
How to use checksums
5061c544af7fb0a61f83ca3cf0ec3933748a433cfec4e2ad65b4c57e1ee980e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.19

Release files / messagebird-2.2.0-py2.py3-none-any.whl

Download URL messagebird-2.2.0-py2.py3-none-any.whl
Size 28.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c92ce85044ad6c5c1d012129b32557767e1709492b8d4c93be037fed1b8e9db0
BLAKE2b-256 checksum
How to use checksums
d1e9b41933644cdecd69f488bb98a9c7ed33267274d68642cbf08b4fb96415a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.19

Release history Release notifications | RSS feed

This release

2.2.0 This release

2 release files

2.1.0

2 release files

2.0.0

3 release files

1.6.0

3 release files

1.5.0

2 release files

1.4.1

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.1

1 release file

1.2.0

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page