Skip to main content

Microsoft Azure Communication SMS Client Library for Python

Project description

Build Status

Azure SMS client library for Python

Azure Communication SMS client package is intended to be used to send SMS using an Azure Resource.

Getting started

Prerequisites

  • Python 2.7, or 3.5 or later is required to use this package.
  • You must have an Azure subscription
  • You must have a phone number configured that is associated with an Azure subscription

Install the package

Install the Azure Communication SMS client library for Python with pip:

pip install azure-communication-sms --pre

Key concepts

Azure Communication SMS package is used to do following:

  • Send an SMS

Examples

The following section provides several code snippets covering some of the most common Azure Communication Services tasks, including:

Client Initialization

To initialize the SMS Client, the connection string can be used to instantiate:

connection_string = "COMMUNICATION_SERVICES_CONNECTION_STRING"
sms_client = SmsClient.from_connection_string(connection_string)

Sending an SMS

Once the client is initialized, the .send() method can be invoked:

smsresponse = sms_client.send(
    from_phone_number=PhoneNumber("<leased-phone-number>"),
    to_phone_numbers=[PhoneNumber("<to-phone-number>")],
    message="Hello World via SMS",
    send_sms_options=SendSmsOptions(enable_delivery_report=True)) # optional property
  • leased-phone-number: an SMS enabled phone number associated with your communication service
  • to-phone-number: the phone number you wish to send a message to
  • send_sms_options: an optional parameter that you can use to configure Delivery Reporting. This is useful for scenarios where you want to emit events when SMS messages are delivered.

Troubleshooting

Running into issues? This section should contain details as to what to do there.

Next steps

More sample code should go here, along with links out to the appropriate example tests.

Contributing

If you encounter any bugs or have suggestions, please file an issue in the Issues section of the project.

Impressions

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

azure-communication-sms-1.0.0b3.zip (43.5 kB view details)

Uploaded Source

Built Distribution

azure_communication_sms-1.0.0b3-py2.py3-none-any.whl (27.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file azure-communication-sms-1.0.0b3.zip.

File metadata

  • Download URL: azure-communication-sms-1.0.0b3.zip
  • Upload date:
  • Size: 43.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for azure-communication-sms-1.0.0b3.zip
Algorithm Hash digest
SHA256 d853b0b30966c01e3b7c3cad0c6477df45ff871eee11de39965cfd4a6b00b86b
MD5 4dbdff151acdc86cb84bb18e2d467f27
BLAKE2b-256 8f027eeb860b8d38bbf127e3d0e57d5247b0bd193b5c95db8437b93172e6f898

See more details on using hashes here.

File details

Details for the file azure_communication_sms-1.0.0b3-py2.py3-none-any.whl.

File metadata

  • Download URL: azure_communication_sms-1.0.0b3-py2.py3-none-any.whl
  • Upload date:
  • Size: 27.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for azure_communication_sms-1.0.0b3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9db8dca12d070d85f1a974b7eba627867b7058c00bc496326421ba8c340bf1fe
MD5 f25840d3f7cb09f049801a0a3dce903a
BLAKE2b-256 09f497bf2c1ff883cedae34e4b262c3fa06b41f28c18bfd8f8f122492d2fbe92

See more details on using hashes here.

Supported by

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