-
Notifications
You must be signed in to change notification settings - Fork 0
/
lambdaServiceCall.html
62 lines (60 loc) · 2.04 KB
/
lambdaServiceCall.html
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
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js "></script>
<script>
function getContent(){
var userKey=$("#UserId").val().trim();
var accountType=$("#accountType").val().trim();
if(userKey=='' || userKey=='undefined')
{
alert("UserKey is mandatory");
return false;
}
if(accountType=='' || accountType=='undefined')
{
var settings = {
"crossDomain": true,
"url": "https://hu4xwdeme9.execute-api.us-east-1.amazonaws.com/DEV/bankingbot/accountsummary?userKey="+userKey,
"method": "GET",
"processData": false
}
$.ajax(settings).done(function (response) {
console.log(response);
if(response){
$( "#resp" ).text( JSON.stringify(response, null, '\t') );
}
$('#UserId').val('');
$('#accountType').val('');
$('#resp').val('');
});
}
else
{
var settings = {
"crossDomain": true,
"url": "https://hu4xwdeme9.execute-api.us-east-1.amazonaws.com/DEV/bankingbot/accountsummary?userKey="+userKey+"&accountType="+accountType,
"method": "GET",
"processData": false
}
$.ajax(settings).done(function (response) {
console.log(response);
if(response){
$( "#resp" ).text( JSON.stringify(response, null, '\t') );
}
$('#UserId').val('');
$('#accountType').val('');
});
}}
</script>
</head>
<body align="center">
<title> Welcome to amazon webservice</title>
<p align="center" style="color: DarkOrchid "><b>Welcome to AWS Lambda Application</b></p>
<p style="color: SlateGrey">UserKey
<input type="text" name="UserId" style="color: blue; background-color: MintCream "id="UserId"></p>
<p style="color: SlateGrey">Account Type(Optional)<input type="text" name="accountType" style="color: blue; background-color: MintCream "id="accountType"></p>
<input type="button" value="Send Key" style="color: black;background-color: PaleTurquoise " size="100px" onclick="javascript:getContent()" />
<p style="color: SlateGrey">AWS Response<span></span></p>
<textarea rows="10" cols="50" id="resp" style="color: SlateGrey ; background-color: mintCream" disabled="true"></textarea>
</body>
</html>