Java

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

Code

keyboard_arrow_down
 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
package org.sinch.customerService;

import java.util.Properties;

// _Step_1
public class CustomerDetail
{

    Properties properties;
    private String customerName;
    private String customerId;
    private long mobileNumber;

    public CustomerDetail(Properties prop)
    {
        this.properties = prop;
        this.setId(properties.getProperty("CustomerDetail." + "id"));
        this.setName(properties.getProperty("CustomerDetail." + "name"));
        this.setMobileNumber(properties.getProperty("CustomerDetail." + "mobileNumber")); //Phone numbers have to be in E.164 format.
    }

    public CustomerDetail()
    {
    }

    public String getName()
    {
        return customerName;
    }

    public void setName(String name)
    {
        this.customerName = name;
    }

    public String getId()
    {
        return customerId;
    }

    public void setId(String id)
    {
        this.customerId = id;
    }

    public String getMobileNumber()
    {
        return mobileNumber;
    }

    public void setMobileNumber(String mobileNumber)
    {
        this.mobileNumber = mobileNumber;
    }

    @Override
    public String toString()
    {
        return "CustomerDetail [name=" + customerName + ", id=" + customerId + ", mobileNumber=" + mobileNumber + "]";
    }
}
 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
package org.sinch.customerService;

import java.util.Properties;

// _Step_2
public class BankSalesPerson
{

    Properties properties = null;
    // Declare details of all sales person
    private String bankPersonId;
    private String bankPersonName;
    private String department;
    private long mobileNumber;

    public BankSalesPerson(Properties prop)
    {
        this.properties = prop;
        this.setId(prop.getProperty("BankSalesPerson." + "id"));
        this.setName(prop.getProperty("BankSalesPerson." + "name"));
        this.setDepartment(prop.getProperty("BankSalesPerson." + "department"));
        this.setMobileNumber(prop.getProperty("BankSalesPerson." + "mobileNumber")); //Phone numbers have to be in E.164 format.
    }

    public BankSalesPerson()
    {

    }

    public String getId()
    {
        return bankPersonId;
    }

    public void setId(String id)
    {
        this.bankPersonId = id;
    }

    public String getName()
    {
        return bankPersonName;
    }

    public void setName(String name)
    {
        this.bankPersonName = name;
    }

    public String getDepartment()
    {
        return department;
    }

    public void setDepartment(String department)
    {
        this.department = department;
    }

    public String getMobileNumber()
    {
        return mobileNumber;
    }

    public void setMobileNumber(String mobileNumber)
    {
        this.mobileNumber = mobileNumber;
    }

    @Override
    public String toString()
    {
        return "BankSalesPerson [id=" + bankPersonId + ", name=" + bankPersonName + ", department=" + department + ", mobileNumber="
               + mobileNumber + "]";
    }
}
 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
package org.sinch.customerService;

import java.util.ArrayList;


// _Step_3
public class CustomerProduct
{

    private String customerId;
    private ArrayList<String> product;

    public String getId()
    {
        return customerId;
    }
    public void setId(String id)
    {
        this.customerId = id;
    }
    public ArrayList<String> getProduct()
    {
        return product;
    }
    public void setProduct(ArrayList<String> product)
    {
        this.product = product;
    }
    @Override
    public String toString()
    {
        return "CustomerProduct [id=" + customerId + ", product=" + product + "]";
    }
}
 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
package org.sinch.utility;

// _Step_4
public class CustomerQuery {

    private String customerId;
    private String queryType;
    private String queryContent;

    public String getCustomerId() {
        return customerId;
    }
    public void setCustomerId(String customerId) {
        this.customerId = customerId;
    }
    public String getQueryType() {
        return queryType;
    }
    public void setQueryType(String queryType) {
        this.queryType = queryType;
    }
    public String getQueryContent() {
        return queryContent;
    }
    public void setQueryContent(String queryContent) {
        this.queryContent = queryContent;
    }
    @Override
    public String toString() {
        return "CustomerQuery [customerId=" + customerId + ", queryType=" + queryType + ", queryContent=" + queryContent
                + "]";
    }
}
  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
 97
 98
 99
100
package org.sinch.utility;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;

import org.sinch.customerService.BankSalesPerson;
import org.sinch.customerService.CustomerDetail;
import org.sinch.customerService.CustomerProduct;

public class UploadDetails {

    HashMap<String, CustomerDetail> customerDetailMap;
    HashMap<String, CustomerProduct> customerProductMap;
    HashMap<String, BankSalesPerson> bankPersonDetails;

    public UploadDetails() throws IOException {
        customerDetailMap = new HashMap<String, CustomerDetail>();
        customerProductMap = new HashMap<String, CustomerProduct>();
        bankPersonDetails = new HashMap<String, BankSalesPerson>();
        loadCustomerDeatils();
        loadBankDetails();
    }

    /**
     * This method will load all details of customer from csv file
     * @throws IOException
     */

    // _Step_5
    public void loadCustomerDeatils() throws IOException{
        FileReader fileRead = new FileReader(new File(getClass().getClassLoader().getResource("CustomerList.csv").getFile()));
        BufferedReader reader =new BufferedReader(fileRead);
        String record = null;
        while((record = reader.readLine()) != null )
        {
            CustomerDetail detail = new CustomerDetail();
            CustomerProduct product = new CustomerProduct();
            String[] customerDetailRecord = record.split("\\|");
            detail.setId(customerDetailRecord[0]);
            detail.setName(customerDetailRecord[1]);
            detail.setMobileNumber(Long.parseLong(customerDetailRecord[2]));
            customerDetailMap.put(detail.getId(), detail);
            product.setId(customerDetailRecord[0]);
            ArrayList<String> productList = new ArrayList<String>();
            for(int i = 3; i < customerDetailRecord.length;i++)
            {
                productList.add(customerDetailRecord[i]);
            }
            product.setProduct(productList);
            customerProductMap.put(detail.getId(), product);
        }
    }

    /**
     * This method loads all the details of bank from a csv file
     * @throws IOException
     */
    public void loadBankDetails() throws IOException{
        FileReader fileRead = new FileReader(new File(getClass().getClassLoader().getResource("BankSalesPersonList.csv").getFile()));
        BufferedReader reader =new BufferedReader(fileRead);
        String record = null;
        while((record = reader.readLine()) != null ){
            BankSalesPerson salesPerson = new BankSalesPerson();
            String[] salesPersonDetail = record.split("\\|");
            salesPerson.setId(salesPersonDetail[0]);
            salesPerson.setName(salesPersonDetail[1]);
            salesPerson.setDepartment(salesPersonDetail[2]);
            salesPerson.setMobileNumber(Long.parseLong(salesPersonDetail[3]));
            bankPersonDetails.put(salesPerson.getId(), salesPerson);
        }
    }

    public HashMap<String, CustomerDetail> getCustomerDetailMap() {
        return customerDetailMap;
    }

    public void setCustomerDetailMap(HashMap<String, CustomerDetail> customerDetailMap) {
        this.customerDetailMap = customerDetailMap;
    }

    public HashMap<String, CustomerProduct> getCustomerProductMap() {
        return customerProductMap;
    }

    public void setCustomerProductMap(HashMap<String, CustomerProduct> customerProductMap) {
        this.customerProductMap = customerProductMap;
    }

    public HashMap<String, BankSalesPerson> getBankPersonDetails() {
        return bankPersonDetails;
    }

    public void setBankPersonDetails(HashMap<String, BankSalesPerson> bankPersonDetails) {
        this.bankPersonDetails = bankPersonDetails;
    }
}
 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
package org.sinch.utility;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Properties;

import org.sinch.customerService.CustomerDetail;
import org.sinch.customerService.CustomerProduct;
import org.sinch.customerService.MessageHandler;

public class Advertisment
{

    String SMSContent;
    HashMap<String, CustomerProduct> customerProduct;
    HashMap<String, CustomerDetail> customerDetail;
    static Properties config;
    MessageHandler handler;
    String appKey;
    String appSecret;

    public Advertisment(UploadDetails details) throws IOException
    {
        System.out.println("Loading...");
        config = loadProperties("config.properties");
        String baseUrl = config.getProperty("baseUrl");
        appKey = config.getProperty("appKey"); //Replace with an App Key generated on the App Key area of the portal (Integrate - App Keys)
        appSecret = config.getProperty("appSecret"); //Replace with an App Secret generated on the App Key area of the portal (Integrate - App Keys)
        handler = new MessageHandler(baseUrl);
        customerProduct = new HashMap<String, CustomerProduct>();
        customerProduct = details.getCustomerProductMap();
        customerDetail = new HashMap<String, CustomerDetail>();
        customerDetail = details.getCustomerDetailMap();
        creditCardAdvertisment();
    }

    private Properties loadProperties(String filePath) throws IOException {
        Properties prop = new Properties();
        InputStream input = null;
        ClassLoader loader = Thread.currentThread().getContextClassLoader();

        try {
            input = loader.getResourceAsStream(filePath);
            // load a properties file
            prop.load(input);
        } catch (IOException ex) {
            ex.printStackTrace();
            throw ex;
        } finally {
            if (input != null) {
                try {
                    input.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
        return prop;
    }

    // _Step_6
    // One of the scenario is if a person does not have a credit card as his product
    public void creditCardAdvertisment() throws IOException
    {
        Iterator<String> productIterator = customerProduct.keySet().iterator();
        while(productIterator.hasNext())
        {
            String id = productIterator.next();
            CustomerProduct product = customerProduct.get(id);
            CustomerDetail details = customerDetail.get(id);
            ArrayList<String> productList = product.getProduct();
            if(productList.contains("CREDIT CARD") && (! (productList.contains("PREMIUM CARD"))))
            {
                SMSContent = "Hi " + details.getName() + ", We are offering a new Premoium Credit card for you. Upgrade your card to Premium Card with lots of Benefits";
            }
            handler.sendSMS(SMSContent, details.getMobileNumber() + "", handler.getAccessToken(this.appKey, this.appSecret));
        }
    }
}
  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
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
package org.sinch.utility;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Properties;

import org.sinch.customerService.BankSalesPerson;
import org.sinch.customerService.CustomerDetail;
import org.sinch.customerService.MessageHandler;
public class ComplaintSystem
{

    HashMap<String, ArrayList<CustomerQuery>> querMap;
    HashMap<String, CustomerDetail> customerDetail;
    HashMap<String, BankSalesPerson> bankDetails;
    String SMSContent;
    static Properties config;
    MessageHandler handler;
    String appKey;
    String appSecret;

    public ComplaintSystem(UploadDetails details) throws IOException
    {
        config = loadProperties("config.properties");
        String baseUrl = config.getProperty("baseUrl");
        appKey = config.getProperty("appKey"); //Replace with an App Key generated on the App Key area of the portal (Integrate - App Keys)
        appSecret = config.getProperty("appSecret"); //Replace with an App Secret generated on the App Key area of the portal (Integrate - App Keys)
        handler = new MessageHandler(baseUrl);

        customerDetail = new HashMap<String, CustomerDetail>();
        customerDetail = details.getCustomerDetailMap();
        bankDetails = new HashMap<String, BankSalesPerson>();
        bankDetails = details.getBankPersonDetails();
        loadComplaints();
        updateComplaint();
    }

    private Properties loadProperties(String filePath) throws IOException {
        Properties prop = new Properties();
        InputStream input = null;
        ClassLoader loader = Thread.currentThread().getContextClassLoader();

        try {
            input = loader.getResourceAsStream(filePath);
            // load a properties file
            prop.load(input);
        } catch (IOException ex) {
            ex.printStackTrace();
            throw ex;
        } finally {
            if (input != null) {
                try {
                    input.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
        return prop;
    }

    //Load all the complaints log to bank
    public void loadComplaints() throws IOException
    {
        querMap = new HashMap<String, ArrayList<CustomerQuery>>();
        FileReader fileRead = new FileReader(new File(getClass().getClassLoader().getResource("CustomerQuery.csv").getFile()));
        BufferedReader reader = new BufferedReader(fileRead);
        String record = null;
        while((record = reader.readLine()) != null)
        {
            ArrayList<CustomerQuery> list;
            String[] queryRecord = record.split("\\|");
            CustomerQuery query = new CustomerQuery();
            query.setCustomerId(queryRecord[0]);
            query.setQueryType(queryRecord[1]);
            query.setQueryContent(queryRecord[2]);
            if(querMap.containsKey(query.getCustomerId()))
            {
                list = querMap.get(query.getCustomerId());
                list.add(query);
            }
            else
            {
                list = new ArrayList<CustomerQuery>();
                list.add(query);
            }
            querMap.put(query.getCustomerId(), list);
        }
    }

    // _Step_7
    //Update customer by sending sms according to their query
    public void updateComplaint() throws IOException
    {
        Iterator<String> complaintIterator = querMap.keySet().iterator();
        while(complaintIterator.hasNext())
        {
            String id = complaintIterator.next();
            CustomerDetail detail = customerDetail.get(id);
            ArrayList<CustomerQuery> complaintList = querMap.get(id);
            for(int list = 0; list < complaintList.size(); list++)
            {
                CustomerQuery query = complaintList.get(list);
                if(query.getQueryType().equals("COMPLAINT"))
                {
                    BankSalesPerson person = getBankPerson("COMPLAINT");
                    SMSContent = "Hi " + detail.getName() + " on your complaint " + query.getQueryContent() + " Mr/Ms " + person.getName() + " will contact you Mobile number: " + person.getMobileNumber();
                    break;
                }
                if(query.getQueryType().equals("QUERY"))
                {
                    BankSalesPerson person = getBankPerson("QUERY");
                    SMSContent = "Hi " + detail.getName() + " on your query " + query.getQueryContent() + " Please connect to our sales person Mr/Ms " + person.getName() + " on " + person.getMobileNumber() + " Or our sales person will connect with you in next 3 working days.";
                    break;
                }
                if(query.getQueryType().equals("CRITICAL"))
                {
                    BankSalesPerson person = getBankPerson("CRITICAL");
                    SMSContent = "Hi " + detail.getName() + " on your issue " + query.getQueryContent() + " an appointment with manager is being fixed on " + getDateAndTime() + "";
                    break;
                }
            }
            handler.sendSMS(SMSContent, detail.getMobileNumber() + "", handler.getAccessToken(this.appKey, this.appSecret));
        }
    }

    public BankSalesPerson getBankPerson(String complaintType)
    {
        if(complaintType.equals("COMPLAINT"))
        {
            BankSalesPerson person = bankDetails.get("3");
            return person;
        }
        else
        {
            if(complaintType.equals("QUERY"))
            {
                BankSalesPerson person = bankDetails.get("2");
                return person;
            }
            else
            {
                if(complaintType.equals("CRITICAL"))
                {
                    BankSalesPerson person = bankDetails.get("1");
                    return person;
                }
            }
            return null;
        }
    }

    public String getDateAndTime()
    {
        int days = 1;
        long time = System.currentTimeMillis();
        Date sysDate = new Date(time);
        if(sysDate.getDay() > 5)
        {
            days = 3;
        }
        long newTime = System.currentTimeMillis() + (days * 1000 * 60 * 60 * 24);
        Date newCalculatedDate = new Date(newTime);
        String sysDateString = newCalculatedDate.toString();
        String[] dateSplit = sysDateString.split(" ");
        String appointmentDate = dateSplit[0] + " " + dateSplit[1] + " " + dateSplit[2] + " " + dateSplit[5];
        return appointmentDate;
    }

    public String getSMSContent()
    {
        return SMSContent;
    }

    public void setSMSContent(String sMSContent)
    {
        SMSContent = sMSContent;
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
package org.sinch.utility;

import java.io.IOException;

// _Step_8
public class Main
{
    public static void main( String[] args ) throws IOException
    {
        UploadDetails detail = new UploadDetails();         //Load details of all customers
        Advertisment adds = new Advertisment(detail);           //Updates SMS for advertisement of credit card
        ComplaintSystem sys = new ComplaintSystem(detail);      //Updating SMS content for complaint registered by customer
    }
}
  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
 97
 98
 99
100
101
102
103
104
105
106
107
package org.sinch.customerService;

import org.json.*;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Base64;

public class MessageHandler
{
    private String baseURL;

    public MessageHandler(String baseUrl) {
        this.baseURL = baseUrl;
    }

    public String getAccessToken(String appKey, String appSecret) throws MalformedURLException, IOException
    {
        String token_url = this.baseURL + "/oauth/token";
        //Encode your App Key and App Secret in Base64
        String credentials = appKey + ":" + appSecret;
        String credentialsEncoded = Base64.getEncoder().encodeToString(credentials.getBytes());
        //      System.out.println(credentialsEncoded);
        String param = "grant_type=client_credentials";
        String authTokenJsonString = this.postForAccessToken(token_url, param, credentialsEncoded);
        JSONObject object = new JSONObject(authTokenJsonString);
        //At this point, you will have retrieved your json string, which should be parsed.
        //There are many third parties available for this.
        //From the json string, extract the "access_token" attribute and return it in this function.
        //return "access_token"; //Return the "access_token" field from the json string.
        return object.getString("access_token");
    }
    public String postForAccessToken(String path, String data, String authenticationToken) throws MalformedURLException, IOException
    {
        URL url = new URL(path);
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("POST");
        connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
        connection.setRequestProperty("Accept", "application/json");
        connection.setRequestProperty("Authorization", "Basic " + authenticationToken);
        connection.setDoOutput(true);
        DataOutputStream writer = new DataOutputStream(connection.getOutputStream());
        writer.writeBytes(data);
        writer.flush();
        writer.close();
        InputStreamReader inputStreamReader = new InputStreamReader(connection.getInputStream());
        BufferedReader reader = new BufferedReader(inputStreamReader);
        StringBuilder response = new StringBuilder();
        String inputLine;
        while ((inputLine = reader.readLine()) != null) response.append(inputLine);
        reader.close();
        return response.toString();
    }

    // _Step_9
    public void sendSMS(String message, String destination, String authenticationToken)
    {
        //Make sure to escape all double quotes inside the json, only the outer quotes for each string should be left unescaped.
//        String postBody = "{" + " \"message\": \"" + message + "\"," //This is the string that will be shown to the user.
//                          + " \"destination\": \"" + destination + "\"," //Place here the destination number(s) (Phone numbers have to be in E.164 format)
//                          + "}";
        JSONObject postBody = new JSONObject()
                .put("message", message)
                .put("destination", destination);
        //
        String url = this.baseURL + "/v2/sms";
        try
        {
            this.post(url, postBody.toString(), authenticationToken);
        }
        catch (IOException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    //This is a method that does an http post, given the path/url, data (a json string).
    public String post(String path, String data, String authenticationToken) throws MalformedURLException, IOException
    {
        URL url = new URL(path);
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("POST");
        connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
        if (authenticationToken != null && !authenticationToken.isEmpty())
        {
            connection.setRequestProperty("Authorization", "Bearer " + authenticationToken);
        }
        System.out.println(authenticationToken);
        connection.setDoOutput(true);
        DataOutputStream writer = new DataOutputStream(connection.getOutputStream());
        writer.writeBytes(data);
        writer.flush();
        writer.close();
        InputStreamReader inputStreamReader = new InputStreamReader(connection.getInputStream());
        BufferedReader reader = new BufferedReader(inputStreamReader);
        StringBuilder response = new StringBuilder();
        String inputLine;
        while ((inputLine = reader.readLine()) != null) response.append(inputLine);
        reader.close();
        return response.toString();
    }
}