Python
This is a walkthrough showing you how to connect Live Link 365's SMS-sending API to a flight booking app. This sample creates the model of a flight's booking information and sends an SMS notification to a phone number.
This is not a production-ready application. Please take your time to enhance it for production so that it meets your specific business requirements.
Steps
Create the Python class for CustomerDetail
using the customerId, customerName, mobileNumber, products and queries:
- customerId: String
- customerName: String
- mobileNumber: Long
- products: List
- queries: List
Create the Python class for BankSalesPerson
using the bankPersonId, bankPersonName, department and mobileNumber:
- bankPersonId: String
- bankPersonName: String
- department: String
- mobileNumber: Long
Create the Python class for CustomerProduct
using the customerId and product.
- customerId: String
- product: ArrayList
Create the Python class for CustomerQuery
using the customerId, queryType and queryContent:
- customerId: String
- queryType: String
- queryContent: String
This Python code collects and stores all the information related to customer details and bank person details. This class uses two CSV files, which need to have this format:
BankSalesPersonList:
1|Bruce|Tech|##########
2|Sam|IT||##########
3|Liz|RRHH||##########
CustomerList:
1|John||##########
This Python code will send the advertising messages to the appropriate person by fetching his/her details.
The decision to send the message or not, depends on the product the customer has
This Python code fetches all the queries registered by customer and depending on his or her query (like Complaint, Query or Critical) SMS messages are sent.
This class use a CSV file, which needs to have this format:
CustomerQuery:
1|COMPLAINT|Issue with paying credit card
This Python code calls the method to load a Customer
as well as BankDetails
and then uses the class for CustomerQuery
and Advertisement
This is the Live Link 365 API for sending SMS using Python. This section of the code interfaces with our enterprise messaging hub to send the required SMS to the receiver
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
1 2 3 4 5 6 7 8 9 10 11 |
|
1 2 3 4 5 6 7 8 |
|
1 2 3 4 5 6 7 8 9 10 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
1 2 3 4 5 6 7 8 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|