{"id":19519148,"url":"https://github.com/cmdotcom/text-sdk-python","last_synced_at":"2025-04-26T07:31:08.264Z","repository":{"id":38309677,"uuid":"295347990","full_name":"cmdotcom/text-sdk-python","owner":"cmdotcom","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-13T12:27:58.000Z","size":135,"stargazers_count":2,"open_issues_count":0,"forks_count":6,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-21T14:34:48.985Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cmdotcom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-14T08:09:02.000Z","updated_at":"2024-06-13T12:24:38.000Z","dependencies_parsed_at":"2024-06-13T12:53:50.011Z","dependency_job_id":null,"html_url":"https://github.com/cmdotcom/text-sdk-python","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdotcom%2Ftext-sdk-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdotcom%2Ftext-sdk-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdotcom%2Ftext-sdk-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdotcom%2Ftext-sdk-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmdotcom","download_url":"https://codeload.github.com/cmdotcom/text-sdk-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250953349,"owners_count":21513300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T00:16:34.409Z","updated_at":"2025-04-26T07:31:08.020Z","avatar_url":"https://github.com/cmdotcom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Text-sdk-python\n![publish to PyPi](https://github.com/cmdotcom/text-sdk-python/workflows/publish%20to%20PyPi/badge.svg)\n![PyPi](https://img.shields.io/pypi/v/cm_text_sdk_python\n)\n\n## A helper library to sending messages using python.\nWant to send messages in your Python application? Then you are at the right address.\nIf you want to get all the functionalities, go to: [CM.com API Docs](https://docs.cmtelecom.com/bulk-sms/v1.0)\n\n## Installing\nInclude the SDK by downloading the files manually or running the following command in a Python Shell.\n```python3\n    pip install cm_text_sdk_python\n```\n\n## Instantiate the client\nUse your productToken which authorizes you on the CM platform. Get yours on CM.com\n\n```python3\n    from cm_text import TextClient\n\n    client = TextClient(apikey=key)\n```\n\n## Send a message\nBy calling `SendSingleMessage` and providing message text, sender name, recipient phone number(s).\n\n```python3\n    client = TextClient(apikey=key)\n    client.SendSingleMessage(message=message, from_='CM.com', to=Recipients)\n```\n\n## Sending multiple messages\nBy calling `AddMessage` and providing message text, sender name, recipient phone number(s) you can queue multiple messages. Send them by calling `send`.\n\n```python3\n    client = TextClient(apikey=key)\n    client.AddMessage(message=message, from_='pythonSDK', to=Recipients)\n    client.AddMessage(message=message2, from_='pythonSDK', to=Recipients2)\n    response = client.send()\n```\n\n## Sending a rich message\nBy calling `AddRichMessage` and providing `Media`, message text, sender name, recipient phone number(s) you can queue multiple Rich messages. Send them by calling `send`.\n\n```python3\n    media = {\n            \"mediaName\": \"conversational-commerce\",\n            \"mediaUri\": \"https://www.cm.com/cdn/cm/cm.png\",\n            \"mimeType\": \"image/png\"\n        }\n\n    client = TextClient(apikey=key)\n    client.AddRichMessage(message=message, from_='pythonSDK', to=to, allowedChannels=allowedChannels, media=media)\n    response = client.send()\n```\n\n## Sending a Whatsapp Template message\nBy calling `AddWhatsappTemplateMessage` and providing `Template`, sender name, recipient phone number(s) you can queue multiple Whatsapp Template messages. Send them by calling `send`.\n\n```python3\n    template_namespace = \"Your-Template-Namespace\"\n    template_element_name = \"Replace with Template Name\"\n    template = WhatsappTemplate(template_namespace, template_element_name)\n    \n    client = TextClient(apikey=key)\n    client.AddWhatsappTemplateMessage(from_='pythonSDK', to=to, template=template)\n    response = client.send()\n```\n\nSee Examples folder for more examples.\n\n## Sending Interactive Whatsapp message\nSee the [example file](examples/07_whatsapp_interactive_message.py) for an example.\n\n## Get the result\nSending a message by calling `send` returns the response body. Response is of type: https://requests.readthedocs.io/en/master/user/quickstart/#response-content\n```python3\n    response = client.send()\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmdotcom%2Ftext-sdk-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmdotcom%2Ftext-sdk-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmdotcom%2Ftext-sdk-python/lists"}