-
Notifications
You must be signed in to change notification settings - Fork 3
/
restful_api_keys.html
226 lines (185 loc) · 7.15 KB
/
restful_api_keys.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
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<meta name="generator" content=
"HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
<title>BUGswarm Developers</title>
<link rel="stylesheet" href="bootstrap/bootstrap.css" type=
"text/css">
<link rel="stylesheet" href="css/this.css" type="text/css">
<link rel="stylesheet" href=
"js/google-code-prettify/prettify.css" type="text/css">
<script src="http://code.jquery.com/jquery-1.5.2.js" type=
"text/javascript">
</script>
<script src="js/google-code-prettify/prettify.js" type=
"text/javascript">
</script>
<script src="js/application.js" type="text/javascript">
</script>
<script src="js/google-analytics.js" type="text/javascript">
</script>
</head>
<body>
<!-- NAVIGATION-->
<div class="topbar">
<div class="topbar-inner">
<div class="container">
<h3><a id="banner" href="index.html" name=
"banner"><img src="images/bs_logo.png"></a></h3>
<ul class="nav">
<li class="dropdown nav-dropdown">
<a href="documentation.html" class=
"dropdown-toggle">Documentation</a>
<ul class="dropdown-menu">
<li><a href=
"configuration_api.html">Configuration</a></li>
<li><a href=
"participation_api.html">Participation</a></li>
</ul>
</li>
<li><a href="tools.html">Tools</a></li>
<li><a href="libraries.html">Libraries</a></li>
<li><a href="tutorial.html">Tutorial</a></li>
<li><a href="applications.html">Applications</a></li>
<li><a href="hardware.html">Hardware</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>
</div>
</div><!-- CONTAINER-->
<div class="container">
<!-- Path-->
<div class="page-header">
<a href="index.html">Home</a> → <a href=
"documentation.html">Documentation</a> → <a href=
"configuration_api.html">Configuration API</a> → API
Keys
</div><!-- Jump to dropdown-->
<div class="topbar-inner jump-bar">
<div class="nav jump-nav">
<div class="dropdown jump-dropdown">
<a href="documentation.html" class=
"jump-header dropdown-toggle">Jump to</a>
<ul class="dropdown-menu jump-menu">
<li><a href="#create">Create</a></li>
<li><a href="#list">List</a></li>
</ul>
</div>
</div>
</div><!-- Header-->
<h1>API Keys</h1>
<p>Create and list your API keys. The Configuration API key is
used for all methods associated with the <a href=
"configuration_api.html">Configuration API</a>, including
establishing swarms and their resources as well as managing
invitations. The Participation API key is used for connecting
resources to the swarms they are members of to allow production
and consumption of data in those swarms. More information on
this use can be found in the <a href=
"participation_api.html">Participation API</a>.</p>
<div class="page-header"></div><!-- Create-->
<h3 id="create">Create</h3><!-- description-->
<div class="row">
<div class="span8 columns">
<ul class="unstyled">
<li><strong>URL:</strong>
<code>http://api.bugswarm.net/keys</code></li>
<li><strong>Method:</strong> POST</li>
<li><strong>Authentication:</strong>
<code>"username:password"</code></li>
<li><strong>Parameters (Required):</strong> None</li>
<li><strong>Parameters (Optional):</strong> Key type</li>
</ul>
</div>
<div class="span8 columns">
<p>This method is used to create API keys. If a key already
exists, this method will replace that key with a new one.
To create a specific key, users must specify the key type
in the URL. For instance,
<code>http://api.bugswarm.net/keys/participation</code>
will generate the participation key, while
<code>http://api.bugswarm.net/keys</code> will generate
both keys by default.</p>
</div>
</div><!-- usage--><strong>Usage:</strong>
<pre class="prettyprint language-javascript">
curl -X POST --user "username:password" http://api.bugswarm.net/keys
curl -X POST --user "username:password" http://api.bugswarm.net/keys/configuration
curl -X POST --user "username:password" http://api.bugswarm.net/keys/participation
</pre><!-- returns--><strong>Returns:</strong> The created key(s)
as either a JSON object or, if no type of is specified, an array of
JSON objects.
<pre class="prettyprint language-javascript">
[
{
"created_at": "2011-10-21T15:37:35.636Z",
"key": "b8c2382d0fd9123f3d0ccc760afa03854c652fdb",
"status": "active",
"type": "configuration",
"user_id": "username"
},
{
"created_at": "2011-10-21T15:37:35.744Z",
"key": "c0eb23bb29bcf123d74d79801bdc5b06f1e97bdd",
"status": "active",
"type": "participation",
"user_id": "username"
}
]
</pre>
<div class="page-header"></div><!-- List-->
<h3 id="list">List</h3><!-- description-->
<div class="row">
<div class="span8 columns">
<ul class="unstyled">
<li><strong>URL:</strong>
<code>http://api.bugswarm.net/keys</code></li>
<li><strong>Method:</strong> GET</li>
<li><strong>Authentication:</strong>
<code>"username:password"</code></li>
<li><strong>Parameters (Required):</strong> None</li>
<li><strong>Parameters (Optional):</strong> Key type</li>
</ul>
</div>
<div class="span8 columns">
<p>This method will list the API keys associated with the
user's account. Users may specify which key they would like
to retrieve by specifying the key type in the the URL. For
instance,
<code>http://api.bugswarm.net/keys/configuration</code>
will retrieve the configuration key, while
<code>http://api.bugswarm.net/keys/participation</code>
will retrieve the participation key. If no key type is
specified in the URL, all keys will be returned.</p>
</div>
</div><!-- usage--><strong>Usage:</strong>
<pre class="prettyprint language-javascript">
curl -X GET --user "username:password" http://api.bugswarm.net/keys
curl -X GET --user "username:password" http://api.bugswarm.net/keys/configuration
curl -X GET --user "username:password" http://api.bugswarm.net/keys/participation
</pre><!-- returns--><strong>Returns:</strong> The desired key(s)
as either a JSON object or, if no type is specified, an array of
JSON objects.<br>
<pre class="prettyprint language-javascript">
[
{
"key": "c7cf33294f91c29abc778c8f6382eaaed8405372",
"user_id": "username",
"created_at": "2011-09-09T23:45:22.109Z",
"status": "active",
"type": "configuration"
},
{
"key": "33d1e9e8fe9802e34c99b6c465552a0bc2ca0714",
"user_id": "username",
"created_at": "2011-09-09T23:45:22.221Z",
"status": "active",
"type": "participation"
}
]
</pre>
<div class="page-header"></div>
</div>
</body>
</html>