Send SMS with REST Using Python
In this article, we are going to see how we can send SMS with REST using Python. The requests library can be used to make REST requests using Python to send SMS.
- You need to first create a REST API KEY for sending SMS using Python Script. We have used Fast2SMS for creating API KEY.
- You can go on the website and create an account after which you can have your own API KEY.
- Create a Python File and copy the below code, Replace “API_KEY_OF_YOURS” with your API KEY, and in the numbers parameter, enter the number on which you want to send SMS, you can enter multiple numbers.
Following are the parameters used in GET API:
- authorization – true, Provide “YOUR_API_KEY”. Sign up for API Key
- message – true, Message “text” to be sent
- language – false, Default language is “english”. API will detect “unicode” messages automatically.
- route – true, For Quick SMS use “q”
- numbers – true, You can send multiple mobile numbers separated by commas like: “XXXXXXXX98, YYYYYYYY89”
- flash – false, This field is optional, it will use “0” as a default value or you can set it to “1” for sending a flash message.
Below is the implementation:
SMS Successfully Sent
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course