SMS using Python

Now in this tutorial learn about how to send sms to any number by using API(Application programming interface),So in this tutorial we use Sinch API . So let’s start

Step 1 visit the linkhttps://www.sinch.com/ it will give you the free demonstration of sending the message.

Step 2 : Create an account on the Sinch .

Step 3: Download Python SDK from https://pypi.org/project/clx-sdk-xms/, and install in your system using the pip command.

Step 3 : write the program into you python idle

Program

import clx.xms
import requests

client = clx.xms.Client(service_plan_id='type your Id', token='type you token id')
receiver=int(input("Enter the Receiver Number"))
sender=int(input("Enter Your Number :-"))
create = clx.xms.api.MtBatchTextSmsCreate()
create.sender =str(sender)
create.recipients = {str(receiver)}
create.body = 'This is a test message from your Sinch account'
batch = client.create_batch(create)

Output

sms-output

Subscribe Now