Skip to main content

Python library that helps you send SMS using TextFlow API

Project description

Textflow python client

PyPI PyPI

Supported Python Versions

This library supports the following Python implementations:

  • Python 3.6
  • Python 3.7
  • Python 3.8
  • Python 3.9
  • Python 3.10
  • Python 3.11

Installation

pip install textflowsms

Sending an SMS

To send an SMS, you have to create an API key using the Textflow dashboard. When you register an account, you automatically get an API key with one free SMS which you can send anywhere.

Just send a message

import textflowsms as tf
tf.useKey("YOUR_API_KEY");

tf.sendSMS("+381611231234", "Dummy message text...")

Handle send message request result

result = tf.sendSMS("+381611231234", "Dummy message text...")
if(result.ok):
  print(result.data)
else:
  print(result.message)

Example result object of the successfully sent message

{
    "ok": true,
    "status": 200,
    "message": "Message sent successfully",
    "data": {
        "to": "+381611231234",
        "content": "Dummy message text...",
        "country_code": "RS",
        "price": 0.05,
        "timestamp": 1674759108881
    }
}

Example result object of the unsuccessfully sent message

{
    "ok": false,
    "status": 404,
    "message": "API key not found"
}

Verifying a phone number

You can also use our service to easily verify a phone number, without storing data about the phones that you are about to verify, because we can do it for you.

Example usage

# User has sent his phone number for verification
resultSMS = tf.sendVerificationSMS ("+11234567890", service_name, seconds);

# Show him the code submission form
# We will handle the verification code ourselves

# The user has submitted the code
resultCode = tf.VerifyCode("+11234567890", user_entered_code);
# if `resultCode.valid` is True, then the phone number is verified. 

Verification options

service_name is what the user will see in the verification message, e. g. "Your verification code for Guest is: CODE"

seconds is how many seconds the code is valid. Default is 10 minutes. Maximum is one day.

Getting help

If you need help installing or using the library, please check the FAQ first, and contact us at support@textflow.me if you don't find an answer to your question.

If you've found a bug in the API, package or would like new features added, you are also free to contact us!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

textflowsms-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

textflowsms-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file textflowsms-0.1.0.tar.gz.

File metadata

  • Download URL: textflowsms-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for textflowsms-0.1.0.tar.gz
Algorithm Hash digest
SHA256 23d72ee80346bc6cece7751c8d9a40e032523249459397209bde69e51eb1cd17
MD5 b4c8275e7e4b8e5ba7456fa031ea1e8a
BLAKE2b-256 1e65aad46510d703da6d0d3a08f9a52caa2adaf0f3a24c963043655d4c653160

See more details on using hashes here.

File details

Details for the file textflowsms-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: textflowsms-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for textflowsms-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c09909eccec00757d7c4eaf53a4b5a1d49032980383c6febb3ce874b0c5d81bf
MD5 1837f9b9d99d44cd01f27fe310a301b1
BLAKE2b-256 4fcdf702e0f4e64c0d4f7e2bddb07c3f72f564003ab64e6d0d1cfbda183d55b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page