C#
This guide provides a step-by-step walkthrough of how to use Live Link 365 to build a ‘Bank Customer Service App’ to send updates using SMS.
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 a class Person. Since two of our entities share the same information, we are extending this class to define each of them respectively. Person will have the next attributes:
- id: String
- userName: String
- firstName: String
- lastName: String
- phoneNumber: String
Create a Customer class that extends from the Person class, override the constructor to reflect the parameters needed for a Customer. Customer will have the same properties as Person and a new attribute:
- products: List<Product>
Create a class BankSalesPerson and extend it from Person class, override the constructor to reflect the parameters needed for a BankSalesPerson. BankSalesPerson will have the same properties as Person and a new attribute:
- department: String
Create a class Product, it will have the next attributes:
- id: String
- name: String
Create a class Complaint, it will have the next attributes:
- customerId: String
- type: String
- content: String
Create a class Complaint System, this will handle complaints generated by the customers, it will send a notification to the customer regarding the resolution about its complaint, it will have the next attributes:
- customerDetails: Dictionary<String, Customer>
- bankSalesPersonDetails: Dictionary<<String, BankSalesPerson>>
- complaints: List<Complaint>
- messageHandler: MessageHandler
-
loadComplaints()
: This method is called on the constructor of the class and will read the CustomerComplaints.csv file containing all complaints from customers. The structure of the csv file is: customerId|typeOfComplaint|descriptionOfComplaint. -
updateComplaints()
: This method will read all existing complaints and will generate and send the message to the customer for the complaint status. The message contains the description of the customer complaint, the sales person who will be attending the case and if necessary, the sales person contact information. -
getBankPerson()
: This method will return the sales person who will attend the customer complaint based on the type of complaint filled by the customer. -
getDateAndTime()
: This method will return the appointments date in which the sales person will attend the customer's complaint
This class will fetch the information needed in the whole project his/her details.
This class use three CSV files, which need to have this format:- BankSalesList: id|firstName|lastName|department|phoneNumber
- CustomerList: id|firstName|lastName|phoneNumber|productIdList (separated by comma)
-
ProductsList:
id|productName
This class 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
MessageHandler works as a container for the functionalities required to send SMS through the API. For this step we have created two methods:
GetAccessToken()
: will take the app key and app secret and combine them into a Base64 string, which will then be sent to the "/oauth/token" endpoint to generate and return the authentication tokensendMessage()
: makes the POST request to the API to send the SMS; it receives the message to be sent, the number which we want to send the message, and optionally we can define from wich number we want to send the message
We are finally executing the project. First we fetch the configuration.json
file which contains the information needed in the MessageHandler class, then we use the info a create a messageHandler instance, initialize the UploadDetails
, Advertisement
and ComplaintSystem
classes to fetch their correspodint information.
Once all the information has been loaded, we send the messages to the customers, by calling the creditCardAdvertisement()
method, to send the advertisement messages; and the updateComplaints()
method to inform the customers about the status of their complaints
Code
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 |
|
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 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|