Skip to main content

Sendchamp API wrapper

Project description

sendchamp

Sendchamp API wrapper

Installation

pip install sendchamp

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.2.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.2-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sendchamp-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 5a4ebfe592ae31bf3f921e4d4c821b62ce6b9b95bce0c92b7d6644e7579e0acf
MD5 c3d1af6b982ee7ad884472cabf821c94
BLAKE2b-256 298196c4db27d47584f6ba2d67d3f79ce5ae0b562b6b3ba7374c333bdc610f2d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sendchamp-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6c91b62d000a9f3af6a3c4592b2fd9467118567383506286e8f02c680d30ba84
MD5 a434e7a903d71763bfed01dd2450b434
BLAKE2b-256 176f102c71f56bb94267706dc6b8564c2610ac7a0d189a4349917a8795db24d0

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