Skip to main content

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!

Metadata

Release files for textflowsms 0.1.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 textflowsms 0.1.0
File Size Uploaded
textflowsms-0.1.0.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for textflowsms 0.1.0
File Interpreter ABI Platform
textflowsms-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 kB

Release files / textflowsms-0.1.0.tar.gz

Download URL textflowsms-0.1.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
23d72ee80346bc6cece7751c8d9a40e032523249459397209bde69e51eb1cd17
BLAKE2b-256 checksum
How to use checksums
1e65aad46510d703da6d0d3a08f9a52caa2adaf0f3a24c963043655d4c653160
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.0

Release files / textflowsms-0.1.0-py3-none-any.whl

Download URL textflowsms-0.1.0-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c09909eccec00757d7c4eaf53a4b5a1d49032980383c6febb3ce874b0c5d81bf
BLAKE2b-256 checksum
How to use checksums
4fcdf702e0f4e64c0d4f7e2bddb07c3f72f564003ab64e6d0d1cfbda183d55b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.6

2 release files

0.0.5

2 release files

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