Skip to main content

Python package for Ghasedak SMS API

Project description

GhasedakSMS-python

A Python package for interacting with the GhasedakSMS web service API.

Installation

You can simply install this package with pip:

pip install ghasedak_sms

Usage

import ghasedak_sms

# Create an instance:
sms_api = ghasedak_sms.Ghasedak(baseurl="http://your_base_url/api/v1", apikey="Your APIKEY")

# Check SMS status:
response = sms_api.check_sms_status(ids=['messageId1', 'messageId2'], type='1')
print(response)

# Get account information:
response = sms_api.get_account_information()
print(response)

# Get received SMSes:
response = sms_api.get_received_smses(linenumber='xxxx', isread=False)
print(response)

# Get received SMSes with pagination:
response = sms_api.get_received_smses_paging(linenumber='xxxx', isread=False, startdate='2023-01-01', enddate='2023-01-31', pageindex=0, pagesize=10)
print(response)

# Get OTP template parameters:
response = sms_api.get_otp_template_parameters(templatename='YourTemplateName')
print(response)

# Send a single SMS:
response = sms_api.send_single_sms(message='hello, world!', receptor='09xxxxxxxxx', linenumber='xxxx', senddate='', checkid='')
print(response)

# Send a bulk SMS:
response = sms_api.send_bulk_sms(message='hello, world!', receptors=['09xxxxxxxxx', '09xxxxxxxxx'], linenumber='xxxx', senddate='', checkid='')
print(response)

# Send pair-to-pair SMS:
response = sms_api.send_pair_to_pair_sms(items=[{'message': 'hello', 'receptor': '09xxxxxxxxx', 'linenumber': 'xxxx', 'senddate': '', 'checkid': ''}], udh=False)
print(response)

# Send OTP SMS:
response = sms_api.send_otp_sms(receptor='09xxxxxxxxx', message='Your OTP message')
print(response)

License

Released under the MIT License.

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

ghasedak_sms-1.0.1.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

ghasedak_sms-1.0.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file ghasedak_sms-1.0.1.tar.gz.

File metadata

  • Download URL: ghasedak_sms-1.0.1.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for ghasedak_sms-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a7d926b69d252d87b65e57dc755686af9f8e65c039f28a7b215893f983da15f8
MD5 2899ffb46b6b2f0b58b3be0de58f249a
BLAKE2b-256 501cd7e7cef67b543fd487fcd7b3a09da680bd33e99ff51cdb157c46196f7f2a

See more details on using hashes here.

File details

Details for the file ghasedak_sms-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: ghasedak_sms-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for ghasedak_sms-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 735840968f13381aeac1b4bebe36f366f6be0c3db0a5e0460193bc785c52652e
MD5 7083089ee00a141a873ffb6980826dc6
BLAKE2b-256 a6045047667d2259ab2bf2e0397835f01d728cf35f63a351e36d70f9e82a0843

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