![]() ![]() The send function can accept multiple parameters, which modify the sending differently. The following line simply refers to the sms object and orders the message to be sent to the given phone number. The client will be used every time because it contains objects responsible for all available functions. Formulating server queries belongs to API communication implementation, which the library takes care of for you. Result = (to='+44111222333', message='Hello world!')īut what exactly is going on here? First, a client instance is created, which manages the server connection – which is why you need the token. Simply ordering a single SMS to be sent looks like this: from smsapi.client import SmsApiPlClientĬlient = SmsApiPlClient(access_token=token) In this language, scripts can be clear and concise but at the same time advanced, and our library is no different. Now let’s see what beginning to work with code in Python looks like. Preparations are now complete! Feel free to sign in to the messaging gateway. Paste the auth token into the script or place it in your configuration file.ĭo it yourself #01 – Customer Portal Walkthrough (video tutorial) With it, the program can access the SMSAPI server resources. Next, in the Customer Panel, generate an OAuth 2 authentication token. also helpful: e-mail address for sending invoices and contact phone to your accounting department. ![]() SMS sender name, which you will read about later.personal info: full name, e-mail address and password, phone number.Also, remember to complete the necessary information: This way, we will commence our cooperation, and you can use the entire SMS API. There is one more thing you need to do to send SMS notifications in Python: create and configure your SMSAPI account! You’ll find a quick guide below: It will work “behind the scenes” in the finished app, so no worries – you don’t need to be an expert in network protocols to manage SMS campaigns using software code. They will be handled by the external library Requests, which you must instal. Use the following command line to install the Python file in a few seconds: pip install smsapi-clientĪs with the SMSAPI libraries in other languages, your program will communicate with the server using HTTP methods: GET, PUT, POST and DELETE. This makes for a lightning-fast installation using the pip package manager. It is hosted outside GitHub on the PyPI website (Python Package Index). Send SMS using API – Developer Guide #01 The Python library: installing and configuring SMS sendingīefore you begin coding, we need to prepare a few things.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |