Skip to main content

Sendchamp API wrapper

Project description

sendchamp-py

Sendchamp API wrapper

Installation

pip install sendchamp-py

from sendchamp import Sendchamp

sendchamp = Sendchamp(public_key=PUBLIC_KEY)

Sendchamp API Methods

  1. SMS

    • Send SMS
    • Create Sender ID
    • SMS Delivery report
    • Bulk SMS Delivery report
  2. Voice

    • Text-to-Speech
    • Audio File-to-voice
    • Delivery Report
  3. Customer

    • Customer

      • Create Customer
      • List Customer
      • Update Customer
      • Delete Customer
    • Customer Group

      • Create customer group
      • List customer groups
      • Update customer group
  4. Whatsapp

    • Send Template
    • Send Message
    • Send Video
    • Send Audio
    • Send Location
    • Send Sticker
  5. Verification

    • Send OTP
    • Confirm OTP
  6. Email

    • Send Email

SMS

Sending SMS

data, error = sendchamp.sms.send(
   to=["2342345678912"],
   message= "message test",
   sender_name="Sendchamp",
   route= "international"
)

Create Sender ID

data, error = sendchamp.sms.create_sender_id(
    name="CompanyName",
    sample= "sample",
    use_case="marketing"
)

SMS Delivery report

data, error = sendchamp.sms.delivery_report(
    sms_uid=uid
)

Bulk SMS Delivery report

data, error = sendchamp.sms.bulk_delivery_report(
    bulk_sms_uid=uid
)

Voice

Text-to-Speech

data, error = sendchamp.voice.text_to_speech(
    customer_mobile_number=["2342345678912"],
    message= "register your nin",
    type="outgoing",
    repeat=2
)

File-to-Voice

data, error = sendchamp.voice.audio_to_voice(
    customer_mobile_number=["2342345678912"],
    path= "https://sample-videos.com/audio/mp3/crowd-cheering.mp3",
    repeat=2
)

Voice Delivery Report

data, error = sendchamp.voice.delivery_report(
    voice_uid=uid
)

Customer

Create Customer

data, error = sendchamp.customer.create(
    phone_number="2342345678912",
    first_name="kenneth",
    last_name="gabriel",
    email="kennethgabriel78@gmail.com"
)

List Customer

data, error = sendchamp.customer.list()

Update Customer

data, error = sendchamp.customer.update(
    external_user_id=uid,
    first_name="kenneth_",
    last_name="gabriel_",
    phone_number="2342345678912",
    email="kennethgabriel@gmail.com"
)

Delete Customer

data, error = sendchamp.customer.delete(uid)

Customer Group

Create Group

data, error = sendchamp.customer.group.create(
                    name="Waitlist", 
                    description="first users"
              )

List

data, error = sendchamp.customer.group.list(
                  name="Waitlist", 
                  sample="sample",
                  use_case="use case"
              )

Update Customer Group

data, error   = sendchamp.customer.group.update(
    uid=uid,
    name="Premium Users", 
    description="Paying users")

Whatsapp

Send Template

data, error   = sendchamp.whatsapp.send_template(
    sender="2342345678912",
    recipient="2345678912345",
    template_code="template code",
    custom_data={"Body": {}}
)

Send Message

data, error = sendchamp.whatsapp.send_message(
    sender="234810000000",
    recipient="2342345678912",
    message="message"
)

Send Video

data, error = sendchamp.whatsapp.send_video(
    sender="234810000000",
    recipient="234811111111",
    link="https://sample-videos.com/audio/mp3/crowd-cheering.mp3"
)

Send Audio

data, error = sendchamp.whatsapp.send_audio(
    sender="234810000000",
    recipient="234811111111",
    link="https://sample-videos.com/audio/mp3/crowd-cheering.mp3"
)

Send Location

data, error = sendchamp.whatsapp.send_location(
    sender="234810000000",
    recipient="234811111111",
    longititude=46.662787,
    latitude=23.553610,
    name="Robbu Brazil",
    address="Av. Angélica, 2530 - Bela Vista, São Paulo - SP, 01228-200"
)

Send Sticker

data, error = sendchamp.whatsapp.send_audio(
    sender="234810000000",
    recipient="234811111111",
    link="https://studio.posit.us/api/samples/sticker.webp"
)

Verification

Send OTP

data, error = sendchamp.verification.send_otp(
    channel="channel", 
    sender="234810000000", 
    token_type="numeric", 
    token_length=5, 
    expiration_time=4, 
    customer_email_address="customer@gmail.com",
    customer_mobile_number="234811111111", 
    meta_data={}, 
    token="your_token"
)

Confirm OTP

data, error = sendchamp.verification.confirm_otp(
                verification_reference=ref,
                verification_code=code
              )

Email

Send Email

data, error = sendchamp.email.send(
    subject="Sendchamp subject",
    sender={
        "email":"keosariel@sendchamp.com",
        "name":"keosariel"
    },
    to=[{
        "email":"kennethgabriel78@gmail.com",
        "name":"gabriel"
    }],
    message_body={
        "type": "text/html",
        "value": "email fron sendchamp"
    }
)

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

sendchamp-0.0.1.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

sendchamp-0.0.1-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file sendchamp-0.0.1.tar.gz.

File metadata

  • Download URL: sendchamp-0.0.1.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.4

File hashes

Hashes for sendchamp-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e706ccb0449904d8979c016aaf63c815b29c41a7451ef9a273655973d3323180
MD5 81c3c75269b6972a5ba3ccea43f10974
BLAKE2b-256 fbf7a5810d575c6aa92d6d526551db13094d6f19d60483b5ce3914a8af8b072b

See more details on using hashes here.

File details

Details for the file sendchamp-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: sendchamp-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.4

File hashes

Hashes for sendchamp-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ecfc413276b8ac47e8c11b254f7db8f15db88f32e57f361a66930acf8ee6f5ac
MD5 b81b728e80f703e62014f913d623d2ec
BLAKE2b-256 245c2f7964cc33aff4d3e24c9b10d4518c9a7fbfcd11aafd561a4f1460eb74d6

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