Skip to main content

Sending sms to orange api with python

Project description

PYTHON ORANGE SMS GATE WAY

Orange provides API to send SMS to some countries around the world, but using the API may take you a few hours.

If you are a python developer, don't waste your time. Just use our package and save your time for other meaningful things.

INSTALL

pip install python-orange-sms

GET CREDENTIALS

  1. Go to https://developer.orange.com/ and login or create a new account

  2. Go to my apps

  3. Select your app or create a new app

  4. Get your Client ID

  5. Get your Authorization header

  6. Get your App Name

USAGE

from python_orange_sms import utils

SENDER_NAME = 'Name of your app' # Name of your app in dev console
AUTH_TOKEN = 'Authorization header' # Authorization header from dev console

message = "The sms message you want to send to the recipient" # Your message
recipient_phone_number='243xxxxxxxxx' # a Receiver phone number
dev_phone_number='243xxxxxxxxx' # Sender (your phone number)
#recipient_phone_number and dev_phone_number are international phone numbers without + or leading zeros:  format regex('^[1-9][\d]{10,14}$')

sms = utils.SMS(AUTH_TOKEN = AUTH_TOKEN, )
res = sms.send_sms(message=message,
              dev_phone_number=dev_phone_number,       recipient_phone_number=recipient_phone_number)

print(res)

if res.status_code == 201:
    print('EVERYTHING RIGHT : ', res.text) # SMS sent
else:
    print('SAME THING WRONG : ', res.text) # OOPS

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

python_orange_sms-0.1.4.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

python_orange_sms-0.1.4-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file python_orange_sms-0.1.4.tar.gz.

File metadata

  • Download URL: python_orange_sms-0.1.4.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.2

File hashes

Hashes for python_orange_sms-0.1.4.tar.gz
Algorithm Hash digest
SHA256 e04a205d6ceee9d4faa4f97c647e1781dfedf99f1f4fad64e4b619fc766b8648
MD5 ff4423983ba0978beb3597df23c2d746
BLAKE2b-256 1c60438e68183cdff54ac62c4063ab0949800b1b9d08b1b2fb0065cb6aa3517d

See more details on using hashes here.

File details

Details for the file python_orange_sms-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: python_orange_sms-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.2

File hashes

Hashes for python_orange_sms-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 553af501ccc1f1e85c8c1df40a9089fe02b80537ab93c5cef0cfc50e55c84b54
MD5 9848eea0f575eb408ee099d4c1cea5a5
BLAKE2b-256 38b6134fd8c42a35d75761e0c2553696f5dd38f02fc56626df7bb4aca23204d5

See more details on using hashes here.

Supported by

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