Socket
Socket
Sign inDemoInstall

messagebird

Package Overview
Dependencies
8
Maintainers
4
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    messagebird

MessageBird's REST API


Maintainers
4

Readme

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

Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc