-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.html
More file actions
executable file
·105 lines (92 loc) · 3.36 KB
/
api.html
File metadata and controls
executable file
·105 lines (92 loc) · 3.36 KB
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
---
layout: default
title: APIs @ VA
overview: true
---
<link href='{{ site.baseurl }}/vendor/css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
<style type="text/css">
.swagger-section .swagger-ui-wrap {
line-height: 1;
font-family: "Droid Sans", sans-serif;
max-width: 100%;
margin-left: auto;
margin-right: auto;
}
ul#resources, ul#rooms_endpoint_list.endpoints{
padding: 0;
margin: 0;
}
</style>
<script type="text/javascript">
$(function () {
var url = window.location.search.match(/url=([^&]+)/);
if (url && url.length > 1) {
url = decodeURIComponent(url[1]);
} else {
url = "{{ site.baseurl }}/api-docs/swagger.json";
}
window.swaggerUi = new SwaggerUi({
url: url,
dom_id: "swagger-ui-container",
supportedSubmitMethods: ['get'],
onComplete: function (swaggerApi, swaggerUi) {
if (typeof initOAuth == "function") {
/*
initOAuth({
clientId: "your-client-id",
realm: "your-realms",
appName: "your-app-name"
});
*/
}
$('pre code').each(function (i, e) {
hljs.highlightBlock(e)
});
addApiKeyAuthorization();
},
onFailure: function (data) {
log("Unable to Load SwaggerUI");
},
docExpansion: "none",
sorter: "alpha"
});
function addApiKeyAuthorization() {
var key = encodeURIComponent($('#input_apiKey')[0].value);
if (key && key.trim() != "") {
var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("Authorization", "Bearer " + key, "header");
window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth);
log("added key " + key);
}
}
$('#input_apiKey').change(addApiKeyAuthorization);
// if you have an apiKey you would like to pre-populate on the page for demonstration purposes...
/*
var apiKey = "myApiKeyXXXX123456789";
$('#input_apiKey').val(apiKey);
addApiKeyAuthorization();
*/
window.swaggerUi.load();
function log() {
if ('console' in window) {
console.log.apply(console, arguments);
}
}
});
</script>
<h2>API Resources</h2>
<br/>
<p>This area provides access to API resources that allow you to access content and data for the purpose of building
applications that support citizens.</p>
<p>These APIs are not currently maintained by the government, it is meant to just be a prototype to help show various
stakeholders in federal government, what is possible.</p>
<div id='header'>
<form id='api_selector'>
<div class='input'><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text"/></div>
<div class='input'><a id="explore" href="#">Update token</a></div>
</form>
</div>
<div id="message-bar" class="swagger-ui-wrap"> </div>
<div class="swagger-section">
<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
</div>
<script src="{{ site.baseurl }}/vendor/js/docs.min.js"></script>