Giter Club home page Giter Club logo

textmagic-rest-python's Introduction

TextMagic Python SDK

This library provides you with an easy way of sending SMS and receiving replies by integrating TextMagic SMS Gateway into your Python application.

What Is TextMagic?

TextMagic’s application programming interface (API) provides the communication link between your application and TextMagic’s SMS Gateway, allowing you to send and receive text messages and to check the delivery status of text messages you’ve already sent.

Requirements

Python 2.7 and 3.4+ comment: <> (/HEAD)

Installation

pip install git+https://github.com/imissyouso/[email protected]

Usage Example

import TextMagic
from TextMagic.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = TextMagic.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))

# Simple ping request example
try:
    response = api_instance.ping()
    print(response.ping)
except ApiException as e:
    print("Exception when calling TextMagicApi->ping: %s\n" % e)

# Send a new message request example
send_message_input_object = TextMagic.SendMessageInputObject()
send_message_input_object.text = "I love TextMagic!"
send_message_input_object.phones = "+79998887766"

try:
    response = api_instance.send_message(send_message_input_object)
    print(response.id)
except ApiException as e:
    print("Exception when calling TextMagicApi->send_message: %s\n" % e)

# Get all outgoing messages request example
try:
    response = api_instance.get_all_outbound_messages(page=1, limit=200)
    print(response.resources[0].text)
except ApiException as e:
    print("Exception when calling TextMagicApi->get_all_outbound_messages: %s\n" % e)

# Upload a new list (contacts group) avatar request example. 3223 here is a test list id
try:
    response = api_instance.upload_list_avatar('test.png', 3223)
    print(response.id)
except ApiException as e:
    print("Exception when calling TextMagicApi->upload_list_avatar: %s\n" % e)

License

The library is available as open source under the terms of the MIT License. comment: <> (/FOOTER)

textmagic-rest-python's People

Contributors

imissyouso avatar

Watchers

 avatar  avatar

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.