-
Notifications
You must be signed in to change notification settings - Fork 55
/
apiKey.html
120 lines (86 loc) · 4.15 KB
/
apiKey.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
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
<!DOCTYPE html>
<html>
<head>
<title>Core — RingCentral™ Platform</title>
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="common.css">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
</head>
<body>
<div class="container">
<h1>
<a href="index.html" id="logo"></a>
</h1>
<hr>
<form class="panel panel-default form-horizontal" onSubmit="save()" role="form">
<div class="panel-heading"><h1 class="panel-title">Application Key</h1></div>
<div class="panel-body">
<div class="form-group">
<label for="appKey" class="col-xs-2 control-label">APP Key</label>
<div class="col-xs-10">
<input type="text" class="form-control" id="appKey" placeholder="APP Key" required>
</div>
</div>
<div class="form-group">
<label for="appSecret" class="col-xs-2 control-label">APP Secret</label>
<div class="col-xs-10">
<input type="text" class="form-control" id="appSecret" placeholder="App Secret">
</div>
</div>
<div class="form-group">
<label for="server" class="col-xs-2 control-label">Server</label>
<div class="col-xs-10">
<input type="text" class="form-control" id="server" placeholder="https://platform.ringcentral.com" required>
</div>
</div>
<div class="form-group">
<p id="isTokenValid" class="col-xs-offset-2 col-xs-10 form-control-static text-danger">
<span class="glyphicon glyphicon-warning-sign"></span>
You are currently logged in, access token will be revoked so you will be logged out.
</p>
</div>
</div>
<div class="panel-footer text-center">
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-ok"></span> Save</button>
<a class="btn btn-link" href="index.html">Cancel</a>
</div>
</form>
<hr>
<p class="text-center text-muted">
© 1999 – <span id="date"></span> RingCentral™, Inc. All rights reserved.
<script> document.getElementById('date').innerHTML = (new Date()).getFullYear().toString(); </script>
</p>
</div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/fetch/2.0.2/fetch.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/es6-promise/4.0.5/es6-promise.auto.js"></script>
<script type="text/javascript" src="https://cdn.pubnub.com/sdk/javascript/pubnub.4.27.6.js"></script>
<script src="../build/ringcentral.js" type="text/javascript"></script>
<script src="scripts.js" type="text/javascript"></script>
<script type="text/javascript">
var form = document.getElementsByTagName('form')[0],
isTokenValid = document.getElementById('isTokenValid'),
appKeyField = document.getElementById('appKey'),
appSecretField = document.getElementById('appSecret'),
serverField = document.getElementById('server');
function app() {
var sdk = getSDK(),
platform = sdk.platform();
isTokenValid.style.display = platform.auth().accessTokenValid() ? '' : 'none';
appKeyField.value = platform._appKey;
appSecretField.value = platform._appSecret;
serverField.value = platform._server || RingCentral.SDK.server.sandbox;
}
function save() {
localStorage.setItem('ringcentral-demo-server', serverField.value.trim());
localStorage.setItem('ringcentral-demo-appKey', appKeyField.value.trim());
localStorage.setItem('ringcentral-demo-appSecret', appSecretField.value.trim());
alert('Saved');
app();
}
app();
</script>
</body>
</html>