-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathexample-url.html
62 lines (55 loc) · 2.13 KB
/
example-url.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='../dist/bouquet.js'></script>
</head>
<body>
<p>Simple example displaying a request URL made from a query object</p>
url :
<pre id='root'></pre>
<script>
var query = {
path : "/analytics/@'5899bc6715abcc6bed69d766'.@bookmark:'58a5dc6b45d778b2bdb231c9'/query",
data : {
period: "'Saletime'",
timeframe: [
"2008-01-01",
"2008-12-31"
],
filters: [ ],
domain: "'Sales'",
groupBy: [
"MONTHLY('Saletime') as 'saletime'"
],
metrics: [
"'Total quantity sold'",
"'Total available tickets'-'Total quantity sold' as 'Remaining tickets'"
],
orderBy: [
"desc('Total quantity sold')",
"DESC('% sold')"
],
limit: 1000,
beyondLimit: [
"0"
],
style: "HUMAN",
bbid: "@'5899bc6715abcc6bed69d766'.@'public:sales'"
}
}
var bouquetServer = "//demo.openbouquet.io/release/v4.2";
var bouquet = new Bouquet({
url : bouquetServer,
clientId : 'api-key-client',
apiKey : 'eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJhcGkta2V5LWNsaWVudCIsInN1YiI6IjU4YWM1Y2FiMTVhYmNjMTJiYjUwYTU0MCIsInVzZXJFbWFpbCI6ImRlbW9AbG9jYWxob3N0LmNvbSIsImN1c3RvbWVySWQiOiI1OGFjNTNjMDE1YWJjYzEyYmI1MGE0NWIiLCJqdGkiOiJnTmF3dHdiZzRaYXRtQ1JXVVRQYnFnIiwiZXhwIjo0NjQxNTM0NTE5LCJpYXQiOjE0ODc5MzQ1MTksIm5iZiI6MTQ4NzkzNDM5OX0.g5f1DHxESj9PvC5meP8UKXmcZzbGZIiW-qwZ7mNAZWTlMlaAdIn1EBOZzB9oAwHzQxS0qez0iRDac874YCmnHrwYI8kgVoJQvbbJedKIJjfP_V_ZPvMiAfsX0wqeCmqG4_uXZoAh_sumvyDkKGfzutAfpR3DCVkWTqfYZ-iornkyYwH89Yqe_yBNQPO4pXpf3Dg68BlruZqc-tiow3ytynyxuEYEOPYIuyRL-fLpjNstRGa_gXIQYBx9v1yVGlZsQFVviJ5PMbCgIduM36g5leA_IXprw46KxjH_snbnEvAHypZCwhNaJJxlLGBEWTMnFKqytR68CGURskRM2D0VPQ'
});
document.getElementById('root').innerHTML = "RUNNING...";
bouquet.getRequestUrl(query)
.then(function(url) {
document.getElementById('root').innerHTML = "<a href='"+url+"'>"+url+"</a>";
})
.catch(function(err) {
console.error(err);
});
</script>
</body>
</html>