Sendchamp API wrapper
pip install sendchamp-py
from sendchamp import Sendchamp
sendchamp = Sendchamp(public_key=PUBLIC_KEY)
-
- Send SMS
- Create Sender ID
- SMS Delivery report
- Bulk SMS Delivery report
-
- Text-to-Speech
- Audio File-to-voice
- Delivery Report
-
Customer
-
- Create Customer
- List Customer
- Update Customer
- Delete Customer
-
- Create customer group
- List customer groups
- Update customer group
-
-
- Send Template
- Send Message
- Send Video
- Send Audio
- Send Location
- Send Sticker
-
- Send OTP
- Confirm OTP
-
- Send Email
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
)
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
)
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)
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")
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"
)
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
)
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"
}
)