This repository was archived by the owner on Aug 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathapi.html
More file actions
878 lines (754 loc) · 28.1 KB
/
api.html
File metadata and controls
878 lines (754 loc) · 28.1 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
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="robots" content="noodp" />
<title>18F - Micro-purchase</title>
<meta property="og:title" content="18F - Micro-purchase">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" media="all" href="assets/application-e5d61d9fdbed3db45d23f3a3d1305d55f510f261ecfe3a9fc260025f259f26df.css" debug="true" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
//<![CDATA[
window.jQuery || document.write(unescape('%3Cscript src="/assets/jquery-838a8314f0932a08b822e07ddb23086e6e381a141f3d3a8263f8a42ccdadc50f.js">%3C/script>'))
//]]>
</script>
<script src="assets/application-30e199d0f957b76cbc8263396309fcba7602b98bf636f4cc51dcd692351732b6.js" debug="true"></script>
<link rel="shortcut icon" type="image/x-icon" href="assets/favicon-69ed8e7688dee6852c16309cb9f7c58ec43560321d03fb7605874c792b23d02f.ico" />
<!-- Meta tags -->
<meta name="twitter:site" content="@18F">
<meta name="twitter:creator" content="@18F">
<meta property="og:site_name" content="18F - Micro-purchase" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://micropurchase.18f.gov" />
<link rel="canonical" href="https://micropurchase.18f.gov" />
<meta name="description" content="The Micro-purchase Marketplace is the place to bid on open-source issues from the 18F team.">
<meta property="og:description" content="The Micro-purchase Marketplace is the place to bid on open-source issues from the 18F team.">
<meta name="twitter:card" content="summary">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-48605964-40', 'auto');
ga('set', 'anonymizeIp', true);
ga('set', 'forceSSL', true);
ga('send', 'pageview');
</script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body class="site">
<div class="usa-disclaimer">
<div class="usa-grid">
<div class="usa-width-one-whole">
<span class="usa-disclaimer-official">
<img class="usa-flag_icon" alt="US flag signifying that this is a United States Federal Government website" src="assets/uswds/us_flag_small-8a6f68dd8703ce4cb475c92fc1eefa84c41f4741ec4c6ca8403ef99b74b94d20.png" />
An official website of the United States Government
</span>
</div>
</div>
</div>
<header class="header">
<div class="usa-grid">
<div class="usa-grid-one-half icon">
<a href="index.html">
<div class="title">
Micro-purchase <span class="usa-label label-beta">Beta</span>
<div class="subtitle">A marketplace for open source work</div>
</div>
</a> </div>
</div>
</header>
<div class="site-content">
<div class="usa-grid">
<div class="usa-alert usa-alert-info">
<div class="usa-alert-body">
<h3 class="usa-alert-heading">Archival status</h3>
<p class="usa-alert-text">This site has been archived until further notice. As part of this status, the REST API has been replaced with bulk data. The bulk data contains all data that was available on the API.</p>
</div>
</div>
<h1>API Documentation</h1>
<h2>Bulk Data</h2>
<div class="usa-width-one-whole">
<p><a href="./data.json">Download the bulk data</a></p>
</div>
<hr>
<h2>Previous API - <em>not currently operational</em></h2>
<aside class="usa-width-one-fourth">
<ul class="usa-sidenav-list">
<li>
<a href="api#version">Current Version</a>
</li>
<li>
<a href="api#requests">Requests</a>
<li>
<li>
<a href="api#authentication">Authentication</a>
</li>
<li>
<a href="api#quickstart">Quick Start</a>
</li>
<li>
<a href="api#methods">API methods</a>
<ul class="usa-sidenav-sub_list">
<li>
<a href="api#get-auctions">GET /auctions</a>
</li>
<li>
<a href="api#get-auctions-id">GET /auctions/{id}</a>
</li>
<li>
<a href="api#post-auctions-id-bids">POST /auctions/{id}/bids</a>
</li>
<li>
<a href="api#get-admin-auctions">GET /admin/auctions</a>
</li>
<li>
<a href="api#get-admin-auctions-id">GET /admin/auctions/{id}</a>
</li>
<li>
<a href="api#get-admin-users">GET /admin/users</a>
</li>
</ul>
<li>
<li>
<a href="api#definitions">Type Definitions</a>
<ul class="usa-sidenav-sub_list">
<li>
<a href="api#definition-Auction">Auction</a>
</li>
<li>
<a href="api#definition-WinningBid">WinningBid</a>
</li>
<li>
<a href="api#definition-Bid">Bid</a>
</li>
<li>
<a href="api#definition-Bidder">Bidder</a>
</li>
<li>
<a href="api#definition-AuctionResponse">AuctionResponse</a>
</li>
<li>
<a href="api#definition-AuctionListResponse">AuctionListResponse</a>
</li>
<li>
<a href="api#definition-BidResponse">BidResponse</a>
</li>
<li>
<a href="api#definition-AdminAuction">AdminAuction</a>
</li>
<li>
<a href="api#definition-AdminAuctionResponse">AdminAuctionResponse</a>
</li>
<li>
<a href="api#definition-AdminAuctionListResponse">AdminAuctionListResponse</a>
</li>
<li>
<a href="api#definition-AdminReport">AdminReport</a>
</li>
<li>
<a href="api#definition-AdminUserInfo">AdminUserInfo</a>
</li>
<li>
<a href="api#definition-QuickStats">QuickStats</a>
</li>
<li>
<a href="api#definition-User">User</a>
</li>
<li>
<a href="api#definition-Error">Error</a>
</li>
</ul>
<li>
<a href="api#support">Support</a>
</li>
</ul>
</aside>
<div class="usa-width-three-fourths">
<p>From <a href="https://18f.gsa.gov/2015/10/13/open-source-micropurchasing/">"Open
Source Micro-purchasing: An experiment in federal acquisition"</a>:
<blockquote><p>18F is an open-source team. We currently have hundreds of
publicly available repositories, with dozens under active
development. We've had numerous contributions from colleagues within
government, and contributions from members of the public. But in the
next few weeks, we are going to run an experiment: we want to contract
for contributions. And we want to do it the 18F way.</p>
<p>Part of contracting the 18F way is ensuring that all systems are built
modularly and with APIs as capable as the human interface. The
micro-purchase platform itself is no exception. This means that all
data and transactions that are accessible via the web UI can be
accessed by software using the API.</p>
</blockquote></p>
<p>This documentation for using the API assumes you have some
experience with writing clients for RESTful APIs, although for some
situations you can just use <a href="https://curl.haxx.se/">curl</a>
or <a href="https://stedolan.github.io/jq/">jq</a> to get the
information you need.</p>
<h2 id="version">Current Version</h2>
<p>This documentation is generated from
the <a href="http://micropurchase.18f.gov/api/v0/swagger.json">API's
specification file</a>, written
in <a href="http://swagger.io">Swagger</a>. This file can be used to
validate API responses and to automatically generate client
libraries. We have not verified that auto-generated clients function
correctly, but
please <a href="https://github.com/18F/micropurchase/issues/new)">file
an issue</a> if you try it and it works (or doesn't).</p>
<p>The current version of the API is 0.0.1</p>
<p>The Swagger specification can be found at <a href="https://micropurchase.18f.gov/api/v0/swagger.json">https://micropurchase.18f.gov/api/v0/swagger.json</a></p>
<p>All requests to the API use a base path that includes a version
string. The base path for the current version of the API
is <code>/api/v0</code> and this should be prepended
to all requests.</p>
<p>When a new version is introduced, all methods of the prior version
will be deprecated and after a few months, the endpoints of the
previous version will be removed. It is your responsibility to update
your code for the latest version.</p>
<h2 id="requests">Requests</h2>
<p>All API access is over HTTPS and all data is returned as
JSON. There is no reason to specify the content type for the
response.</p>
<p>Errors will return with the appropriate HTTP status code. In
addition, all errors return a
standardized <a href="api#definition-Error">Error</a> response with an
error string within it.</p>
<h2 id="authentication">Authentication</h2>
<p>Currently all authentication occurs via the GitHub API. Rather than
having the micro-purchase platform generate and store API keys, GitHub
Personal API Tokens act as the API key. If you have created an account
on the micro-purchase platform, you are automatically signed up to use
the API. All you need to do
is <a href="https://github.com/blog/1509-personal-api-tokens">generate
a GitHub Personal API Token</a> (with no scopes) and put it in the
request headers for API requests:</p>
<pre>
<code>
Api-Key: the-personal-api-token
</code>
</pre>
<p>Note that many routes do not require authentication to return
data. For instance, you do not need an API key to see details of a
single auction, although it will reveal your bidding information if an
authentication key is provided. Administrators use the same mechanism
for authentication but also must be marked as admins on the
Micro-purchase platform.</p>
<h2 id="quickstart">Quick Start</h2>
<p>You don't need to write code to see results from the API. In your
terminal, run the following curl command:
<code>
<pre>
$ curl https://micropurchase.18f.gov/api/v0/auctions
</pre>
</code>
This returns a JSON string of
all <a href="api#definition-Auction">Auction</a> resources. Each auction
resource contains its child <a href="api#definition-Bid">Bid</a>
and <a href="api#definition-Bidder">Bidder</a> resources.</p>
<p>If you just want to collect auction data via the API, there is no
need to authenticate. But if you're an auction participant, you'll
need to authenticate to do things such as placing bids and viewing
your own (temporarily) private bidding data.</p>
<p>To get started with authentication,
visit <a href="https://github.com/settings/tokens/new">your GitHub
settings</a> to generate a new private token you will use for the
API. Enter in anything you want in "Token Description". Leave all
scopes unchecked in "Select scopes". Click "Generate token". Copy and
save the token somewhere safe. Once you leave the token page, GitHub
will never reveal it again. The good news is that these tokens are
easily re-creatable.</p>
<h2 id="methods">Methods</h2>
<h3 id="get-auctions">GET /auctions</h3>
<p><p>Returns a list of all auctions (future, available, and closed). Each auction contains bids and each bid contains one bidder. If an auction is still running, <code>bid['bidder_id']</code> and all keys in <code>bidder</code> will be <code>null</code>. This request does not require authentication, but if you are authenticated, your bids will not be redacted. This is consistent with the behavior of the web UI.</p>
</p>
<p>Example response:</p>
<pre><code>
{
"auctions": [
{
"issue_url": "https://github.com/18F/mpt3500/issues/10",
"github_repo": "https://github.com/18F/mpt3500",
"start_price": 3500,
"start_datetime": "2016-01-26T18:00:00+00:00",
"end_datetime": "2016-02-27T17:00:00+00:00",
"title": "Review a blog post",
"description": "Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?\r\n\r\n## A Markdown Quote\r\n\r\n> Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?\r\n\r\n```\r\ndef foo(bar)\r\n 10.times do\r\n puts bar\r\n end\r\nend\r\n```",
"id": 1,
"created_at": "2015-12-21T16:40:01+00:00",
"updated_at": "2015-12-21T16:40:01+00:00",
"summary": "## Summary\r\n\r\nWe need some prose to be proof-read.",
"bids": [
{
"bidder_id": null,
"auction_id": 1,
"amount": 222,
"created_at": "2016-01-06T16:59:59+00:00",
"updated_at": "2016-01-06T16:59:59+00:00",
"id": 68,
"bidder": {
"github_id": null,
"duns_number": null,
"name": null,
"email": null,
"sam_account": null,
"created_at": null,
"updated_at": null,
"id": null
}
},
{
"bidder_id": null,
"auction_id": 1,
"amount": 240,
"created_at": "2016-01-06T16:59:55+00:00",
"updated_at": "2016-01-06T16:59:55+00:00",
"id": 67,
"bidder": {
"github_id": null,
"duns_number": null,
"name": null,
"email": null,
"sam_account": null,
"created_at": null,
"updated_at": null,
"id": null
}
}
]
}
]
}
</code></pre>
<table class="usa-table-borderless">
<thead>
<tr>
<th>Code</th>
<th>Meaning</th>
<th>Return Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>200</td>
<td>Returns a list of auctions
</td>
<td><a href="api#definition-AuctionListResponse">AuctionListResponse</a></td>
</tr>
</tbody>
</table>
<h3 id="get-auctions-id">GET /auctions/{id}</h3>
<p><p>This returns the details of a specific auction, in the same format as the auctions index</p>
</p>
<table class="usa-table-borderless">
<thead>
<tr>
<th>Code</th>
<th>Meaning</th>
<th>Return Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>200</td>
<td>Returns a single auction
</td>
<td><a href="api#definition-AuctionResponse">AuctionResponse</a></td>
</tr>
<tr>
<td>404</td>
<td>The auction is not found
</td>
<td><a href="api#definition-Error">Error</a></td>
</tr>
</tbody>
</table>
<h3 id="post-auctions-id-bids">POST /auctions/{id}/bids</h3>
<p><p>Submit a new bid to an auction via a JSON payload. Only integer bids are allowed and the bid may be rejected if it doesn't meet the validation rules for the auction. You must be authenticated and able to place a bid to use this method.</p>
</p>
<p>Example response:</p>
<pre><code>
{
"bid": {
"bidder_id": 1,
"auction_id": 3,
"amount": 1000,
"created_at": "2016-01-27T01:12:07+00:00",
"updated_at": "2016-01-27T01:12:07+00:00",
"id": 7,
"bidder": {
"github_id": "86790",
"duns_number": "123456789",
"name": "Alan deLevie",
"email": "",
"sam_account": true,
"created_at": "2015-12-23T14:51:34+00:00",
"updated_at": "2016-01-26T01:56:24+00:00",
"id": 1
}
}
}
</code></pre>
<table class="usa-table-borderless">
<thead>
<tr>
<th>Code</th>
<th>Meaning</th>
<th>Return Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>200</td>
<td>Returns the bid object that was created
</td>
<td><a href="api#definition-BidResponse">BidResponse</a></td>
</tr>
<tr>
<td>403</td>
<td>When the user is not authenticated
</td>
<td><a href="api#definition-Error">Error</a></td>
</tr>
<tr>
<td>404</td>
<td>When the auction is not found
</td>
<td><a href="api#definition-Error">Error</a></td>
</tr>
</tbody>
</table>
<h3 id="get-admin-auctions">GET /admin/auctions</h3>
<p><p>The administrator view of all auctions. This includes privileged information which is not shown to end users and requires administrator authentication.</p>
</p>
<table class="usa-table-borderless">
<thead>
<tr>
<th>Code</th>
<th>Meaning</th>
<th>Return Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>200</td>
<td>Returns a list of auctions
</td>
<td><a href="api#definition-AdminAuctionListResponse">AdminAuctionListResponse</a></td>
</tr>
<tr>
<td>403</td>
<td>Returned if the user is not found or is not an admin
</td>
<td><a href="api#definition-Error">Error</a></td>
</tr>
</tbody>
</table>
<h3 id="get-admin-auctions-id">GET /admin/auctions/{id}</h3>
<p><p>The details of a specific auction. </p>
</p>
<table class="usa-table-borderless">
<thead>
<tr>
<th>Code</th>
<th>Meaning</th>
<th>Return Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>200</td>
<td>Returns a single auction
</td>
<td><a href="api#definition-AdminAuctionResponse">AdminAuctionResponse</a></td>
</tr>
<tr>
<td>403</td>
<td>Returned if the user is not found or not an admin
</td>
<td><a href="api#definition-Error">Error</a></td>
</tr>
<tr>
<td>404</td>
<td>If the auction is not found
</td>
<td><a href="api#definition-Error">Error</a></td>
</tr>
</tbody>
</table>
<h3 id="get-admin-users">GET /admin/users</h3>
<p><p>The administrator view of all users. This includes privileged information which is not shown to end users and requires administrator authentication.</p>
</p>
<table class="usa-table-borderless">
<thead>
<tr>
<th>Code</th>
<th>Meaning</th>
<th>Return Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>200</td>
<td>Returns lists of users and metadata
</td>
<td><a href="api#definition-AdminReport">AdminReport</a></td>
</tr>
<tr>
<td>403</td>
<td>Returned if the user is not found or not an admin
</td>
<td><a href="api#definition-Error">Error</a></td>
</tr>
</tbody>
</table>
<h2 id="definitions">Definitions</h2>
<h3 id="definition-Auction">Auction</h3>
<p>The public representation of a single auction</p>
<code>
<pre>
{
"id": 1,
"title": "Auction title",
"summary": "The first part of the auction description",
"description": "The rest of the auction description",
"type": "reverse",
"issue_url": "https://github.com/18F/micropurchase/issues/217",
/* Where the auction pull request should be opened against */
"github_repo": "https://github.com/18f/micropurchase",
"start_price": 3500,
"customer": "18F",
"started_at": "2016-01-01T13:00:00Z",
"ended_at": "2016-01-01T13:00:00Z",
"created_at": "2016-01-01T13:00:00Z",
"updated_at": "2016-01-01T13:00:00Z",
"winning_bid": << <a href="api#definition-WinningBid">WinningBid</a> >>,
"bids": [<< <a href="api#definition-Bid">Bid</a> >>...],
"skills": ["rspec", "ruby on rails"]
}
</pre>
</code>
<h3 id="definition-WinningBid">WinningBid</h3>
<p>The current winning bid for the auction. For open reverse auctions, these fields will provide information about the current lowest bid during the auction. The bidder ID is provided as a convenient way for your program to check if the winning bid is yours. For sealed-bid auctions, these values will be nil until the auction is over and the final winning bid has been determined. If there is no bid, these fields will be nil.</p>
<code>
<pre>
{
"amount": 39,
"bidder_id": 34
}
</pre>
</code>
<h3 id="definition-Bid">Bid</h3>
<p>The public representation of a single bid. Note that in some cases -- for instance, when a reverse auction is still running -- information in the auctions may be redacted with nil</p>
<code>
<pre>
{
"id": 39,
"bidder_id": 45,
"auction_id": 1,
"amount": 2300,
"created_at": "2016-01-01T13:00:00Z",
"updated_at": "2016-01-01T13:00:00Z",
"bidder": << <a href="api#definition-Bidder">Bidder</a> >>
}
</pre>
</code>
<h3 id="definition-Bidder">Bidder</h3>
<p>The public information for a specific bidder. Note that in some cases -- for instance, when a reverse auction is still running -- all information about bidders who are not the authenticated user will be redacted and replaced with <code>nil</code> values.</p>
<code>
<pre>
{
"id": 34,
"github_id": 3402,
"duns_number": "123456789",
"name": "Micah Purchase",
"github_login": "github_login",
"sam_status": "sam_accepted",
"created_at": "2016-01-01T13:00:00Z",
"updated_at": "2016-01-01T13:00:00Z"
}
</pre>
</code>
<h3 id="definition-AuctionResponse">AuctionResponse</h3>
<p>The API currently returns a wrapper around a single auction in its response</p>
<code>
<pre>
{
"auction": << <a href="api#definition-Auction">Auction</a> >>
}
</pre>
</code>
<h3 id="definition-AuctionListResponse">AuctionListResponse</h3>
<p>This response contains an array of one or more auctions</p>
<code>
<pre>
{
"auctions": [<< <a href="api#definition-Auction">Auction</a> >>...]
}
</pre>
</code>
<h3 id="definition-BidResponse">BidResponse</h3>
<p>Returned as a response to submitting a bid</p>
<code>
<pre>
{
"bid": << <a href="api#definition-Bid">Bid</a> >>
}
</pre>
</code>
<h3 id="definition-AdminAuction">AdminAuction</h3>
<p>The admin view of a single auction. This includes all of the fields in the regular <code>Auction</code> class as well as some additional privileged fields</p>
<code>
<pre>
{
"id": 1,
"title": "Auction title",
"summary": "The first part of the auction description",
"description": "The rest of the auction description",
"type": "reverse",
"issue_url": "https://github.com/18F/micropurchase/issues/217",
/* Where the auction pull request should be opened against */
"github_repo": "https://github.com/18f/micropurchase",
"start_price": 3500,
"customer": "18F",
"started_at": "2016-01-01T13:00:00Z",
"ended_at": "2016-01-01T13:00:00Z",
"created_at": "2016-01-01T13:00:00Z",
"updated_at": "2016-01-01T13:00:00Z",
"winning_bid": << <a href="api#definition-WinningBid">WinningBid</a> >>,
"bids": [<< <a href="api#definition-Bid">Bid</a> >>...],
"skills": ["rspec", "ruby on rails"],
"billable_to": "example",
"c2_proposal_url": "http://example.com/",
"notes": "example",
"delivery_due_at": "2016-01-01T13:00:00Z",
"delivery_url": "http://example.com/",
"paid_at": "2016-01-01T13:00:00Z",
}
</pre>
</code>
<h3 id="definition-AdminAuctionResponse">AdminAuctionResponse</h3>
<p>The response for requesting a single auction via the admin API</p>
<code>
<pre>
{
"auction": << <a href="api#definition-Auction">Auction</a> >>
}
</pre>
</code>
<h3 id="definition-AdminAuctionListResponse">AdminAuctionListResponse</h3>
<p>The response for requesting admin auctions</p>
<code>
<pre>
{
"auctions": [<< <a href="api#definition-Auction">Auction</a> >>...]
}
</pre>
</code>
<h3 id="definition-AdminReport">AdminReport</h3>
<code>
<pre>
{
"admin_report": << <a href="api#definition-AdminUserInfo">AdminUserInfo</a> >>
}
</pre>
</code>
<h3 id="definition-AdminUserInfo">AdminUserInfo</h3>
<p>Metadata about users</p>
<code>
<pre>
{
"quick_stats": << <a href="api#definition-QuickStats">QuickStats</a> >>,
"non_admin_users": [<< <a href="api#definition-User">User</a> >>...],
"admin_users": [<< <a href="api#definition-User">User</a> >>...]
}
</pre>
</code>
<h3 id="definition-QuickStats">QuickStats</h3>
<code>
<pre>
{
"total_users": 87,
"users_with_duns": 23,
"users_in_sam": 21,
"notes": "example"
}
</pre>
</code>
<h3 id="definition-User">User</h3>
<p>The admin information about a user</p>
<code>
<pre>
{
"id": 39,
"github_id": 34001,
"contracting_officer": false,
"small_business": false,
"duns_number": "123456789",
"name": "Micah Purchase",
"created_at": "2016-01-01T13:00:00Z",
"updated_at": "2016-01-01T13:00:00Z",
"email": "user@example.com",
"sam_status": "duns_blank",
"payment_url": "http://example.com/",
"github_login": "example"
}
</pre>
</code>
<h3 id="definition-Error">Error</h3>
<p>The standard format for error messages</p>
<code>
<pre>
{
"error": "You must be authenticated to bid on an auction"
}
</pre>
</code>
</div>
</div>
</div>
<footer class="usa-footer usa-footer-slim" role="contentinfo">
<div class="usa-footer-primary-section">
<div class="usa-grid-full">
<nav class="usa-footer-nav usa-width-two-thirds">
<ul class="usa-unstyled-list">
<li class="usa-width-one-sixth usa-footer-primary-content">
<a class="usa-footer-primary-link" href="about.html">About</a>
</li>
<li class="usa-width-one-sixth usa-footer-primary-content">
<a class="usa-footer-primary-link" href="policies.html">Policies</a>
</li>
<li class="usa-width-one-sixth usa-footer-primary-content">
<a class="usa-footer-primary-link" href="docs.1.html">Docs</a>
</li>
<li class="usa-width-one-sixth usa-footer-primary-content">
<a class="usa-footer-primary-link" href="insights.html">Insights</a>
</li>
<li class="usa-width-one-sixth usa-footer-primary-content">
<a class="usa-footer-primary-link" href="api.html">API</a>
</li>
</ul>
</nav>
<div class="usa-width-one-third">
<div class="usa-footer-primary-content usa-footer-contact_info">
<a href="https://github.com/18F/micropurchase/">
<i class="fa fa-github"></i> View on GitHub
</a>
</div>
<div class="usa-footer-primary-content usa-footer-contact_info">
<a href="mailto:micropurchase@gsa.gov">micropurchase@gsa.gov</a>
</div>
</div>
</div>
</div>
<div class="usa-footer-secondary_section">
<div class="usa-grid">
<div class="usa-footer-logo">
<img class="usa-footer-slim-logo-img logo-img" alt="Logo image" src="assets/18F-Logo-2016-Blue-6710315924c9b82b3a0bbf41a40b953176c442dd7e0e5b63e69ce89c0ce8ad87.svg" />
<div class="usa-footer-slim-logo-heading">Micro-purchase</div>
</div>
</div>
</div>
</footer>
<script src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js" id="_fed_an_ua_tag"></script>
</body>
</html>