Skip to main content

Python SDK for text with CM.

Project description

Text-sdk-python

Under Construction.

A helper library to sending messages using python.

Want to send messages in your Python application? Then you are at the right address. If you want to get all the functionalities, go to: CM.com API Docs

Installing

Under Construction

Instantiate the client

Use your productToken which authorizes you on the CM platform. Get yours on CM.com

    from CMText.TextClient import TextClient

    client = TextClient(apikey=key)

Send a message

By calling SendSingleMessage and providing message text, sender name, recipient phone number(s).

    client = TextClient(apikey=key)
    client.SendSingleMessage(message=message, from_='CM.com', to=Recipients)

Sending multiple messages

By calling AddMessage and providing message text, sender name, recipient phone number(s) you can queue multiple messages. Send them by calling send.

    client = TextClient(apikey=key)
    client.AddMessage(message=message, from_='pythonSDK', to=Recipients)
    client.AddMessage(message=message2, from_='pythonSDK', to=Recipients2)
    response = client.send()

Sending a rich message

By calling AddRichMessage and providing Media, message text, sender name, recipient phone number(s) you can queue multiple Rich messages. Send them by calling send.

    media = {
            "mediaName": "conversational-commerce",
            "mediaUri": "https://www.cm.com/cdn/cm/cm.png",
            "mimeType": "image/png"
        }

    client = TextClient(apikey=key)
    client.AddRichMessage(message=message, from_='pythonSDK', to=to, allowedChannels=allowedChannels, media=media)
    response = client.send()

Get the result

Sending a message by calling send returns the response body. Response is of type: https://requests.readthedocs.io/en/master/user/quickstart/#response-content

    response = client.send()

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

CM_text_sdk_python-1.0.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

CM_text_sdk_python-1.0.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file CM_text_sdk_python-1.0.0.tar.gz.

File metadata

  • Download URL: CM_text_sdk_python-1.0.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

File hashes

Hashes for CM_text_sdk_python-1.0.0.tar.gz
Algorithm Hash digest
SHA256 53f0d71a2481968ac5f7d18968f09c962880f704f7a7f29f1e99e20d5063a2b0
MD5 db3cad856e0f670faee6f404ff77d24e
BLAKE2b-256 09d8f67ff7091243553a450da8790013d763af8c5ba5392f3f01b69859c6e682

See more details on using hashes here.

File details

Details for the file CM_text_sdk_python-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: CM_text_sdk_python-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

File hashes

Hashes for CM_text_sdk_python-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a1d4ce8cd7ba6a93cfc63c0f1712976d3ea0cbc5cbf03868d8dc94a039fdc69
MD5 e7400e21cb64e5292a8e4381a917c0e9
BLAKE2b-256 65ded34d79c2ba8612d870e89e4e5a2dbe3948638e77015df88ab4819e3d8472

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