forked from codeforamerica/cfapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
955 lines (927 loc) · 33.1 KB
/
index.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
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
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link href="//style.codeforamerica.org/2/style/css/prism.css" rel="stylesheet" />
<link href="//style.codeforamerica.org/2/style/css/main.css" rel="stylesheet">
<link href="//style.codeforamerica.org/2/style/css/documentation.css" rel="stylesheet">
<link href="//style.codeforamerica.org/2/style/css/layout.css" media="all and (min-width: 40em)" rel="stylesheet">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!--[if (lt IE 9)&(!IEMobile)]>
<link rel="stylesheet" href="//style.codeforamerica.org/2/style/css/layout.css" media="all">
<![endif]-->
<title>Civic Tech Movement API</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--
<link href="/api/static/normalize.css" rel="stylesheet" type="text/css">
<link href="/api/static/grid.css" rel="stylesheet" type="text/css">
<style type="text/css">
dt
{
display: list-item;
list-style-type: disc;
list-style-position: inside;
}
dd dt { list-style-type: circle }
dd { margin-left: 1.5em; margin-bottom: .5em }
</style>
-->
</head>
<body class="container">
<div class="layout-breve">
<h1>The Code for America API</h1>
<p>Read more at <a href="https://github.com/codeforamerica/cfapi#readme">https://github.com/codeforamerica/cfapi</a>.</p>
<p>Endpoints:</p>
<ul>
<li><a href="#api-organizations">Organizations</a> (also in <a href="#api-organizations-geojson">GeoJSON</a>)</li>
<li><a href="#api-projects">Projects</a></li>
<li><a href="#api-events">Events</a></li>
<li><a href="#api-stories">Stories</a></li>
<li><a href="#api-issues">Issues</a></li>
</ul>
</div>
<div class="layout-breve">
<h2>
Organizations
<a id="api-organizations" href="#api-organizations">¶</a>
</h2>
<div class="layout-minim">
<p>
Retrieve a list of organizations, also called brigades.
</p>
<h4>Endpoint</h4>
<p>
/api/organizations
</p>
<p>
/api/organizations?param=value&param2=value2
</p>
<h4>Url parameters</h4>
<dl>
<dt>q <i>(string)</i></dt>
<dd>A search term by which results will be filtered:<br><br>
/api/organizations?q=code%20for<br><br>
searches content of the name <a href="#organization-properties">property</a>.<br><br></dd>
<dt>per_page <i>(integer)</i></dt>
<dd>The number of results to return per page:<br><br>
/api/organizations?per_page=5<br><br></dd>
<dt>tags<i>(array of strings)</i></dt>
<dd>An array of tags to filter the results by. For example, to select only the Code for America Brigades:<br><br>
/api/organizations?tags[]=Code%20for%20America&tags[]=Brigade<br><br></dd>
<dt>Organization properties</dt>
<dd>You can add any of the <a href="#organization-properties">Organization properties</a> as a parameter and the API will filter by organizations that have that property.</dd>
</dl>
<h4>Response Properties</h4>
<dl>
<dt>pages</dt>
<dd>Dictionary of pagination links, optionally including <i>first</i>, <i>prev</i>, <i>next</i>, and <i>last</i>.</dd>
<dt>objects</dt>
<dd>List of <a href="#organization-properties">individual organizations</a>.</dd>
</dl>
</div>
<div class="layout-minim">
<h4>Sample Request</h4>
<p><code><a href="{{ api_base }}/api/organizations">{{ api_base }}/api/organizations</a></code></p>
<h4>Sample Response</h4>
<pre><code>{
"pages": {
"next": …,
"last": …
},
"objects": [
{
"type": "Brigade",
"name": "Open Oakland",
…
},
{
"type": "Code for All",
"name": "Code for Berlin",
…
},
…
]
}</code></pre>
<h4>Sample Request with query params</h4>
<p><code><a href="{{ api_base }}/api/organizations?type=Brigade">{{ api_base }}/api/organizations?type=Brigade</a></code></p>
<h4>Sample Response</h4>
<pre><code>{
"pages": {
"next": …,
"last": …
},
"objects": [
{
"type": "Brigade, Code for All",
"name": "OK Lab Hamburg",
…
},
{
"type": "Brigade",
"name": "Code for Puerto Rico",
…
},
…
]
}</code></pre>
</div>
</div>
<div class="layout-breve">
<h2>
Organizations GeoJSON
<a id="api-organizations-geojson" href="#api-organizations-geojson">¶</a>
</h2>
<div class="layout-minim">
<p>
Retrieve a list of organizations, in
<a href="http://geojson.org">GeoJSON format</a>
for geographic applications.
</p>
<h4>Endpoint</h4>
<p>
/api/organizations.geojson
</p>
<h4>Response Properties</h4>
<dl>
<dt>type</dt>
<dd><q>FeatureCollection</q></dd>
<dt>features</dt>
<dd>
List of <a href="http://geojson.org/geojson-spec.html#feature-objects">feature objects</a>
with these properties:
<dl>
<dt>type</dt>
<dd><q>Feature</q></dd>
<dt>id</dt>
<dd>Unique identifier for organization.</dd>
<dt>geometry</dt>
<dd>Point <a href="http://geojson.org/geojson-spec.html#geometry-objects">geometry object</a> with organization location.</dd>
<dt>properties</dt>
<dd>Feature properties, selected from <a href="#organization-properties">properties for a single organization</a>.</dd>
</dl>
</dd>
</dl>
</div>
<div class="layout-minim">
<h4>Sample Request</h4>
<p><code><a href="{{ api_base }}/api/organizations.geojson">{{ api_base }}/api/organizations.geojson</a></code></p>
<h4>Sample Response</h4>
<pre><code>{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": "Open-Oakland",
"geometry": {
"type": "Point",
"coordinates": [ -122.2711, 37.8044 ]
},
"properties": {
"name": "Open Oakland",
"website": "http://openoakland.org/",
"city": "Oakland, CA",
…
}
},
…
]
}</code></pre>
</div>
</div>
<div class="layout-breve">
<h2>
One Organization
</h2>
<div class="layout-minim">
<p>
Retrieve a single organization.
</p>
<h4>Endpoint</h4>
<p>
/api/organizations/{organization id}
</p>
<h4>
Organization Properties
<a id="organization-properties" href="#organization-properties">¶</a>
</h4>
<dl>
<dt>id</dt>
<dd>Code for America API id</dd>
<dt>name</dt>
<dd>Offical name.</dd>
<dt>website</dt>
<dd>Informational website.</dd>
<dt>city</dt>
<dd>Home city of the organization.</dd>
<dt>latitude</dt>
<dd>Geographic latitude, in degrees.</dd>
<dt>longitude</dt>
<dd>Geographic longitude, in degrees.</dd>
<dt>api_url</dt>
<dd>Link to complete API information for this organization.</dd>
<dt>started_on</dt>
<dd>Optional start data for the organization.</dd>
<dt>current_events</dt>
<dd>Selection of current <a href="#event-properties">event dictionaries</a>.</dd>
<dt>all_events</dt>
<dd>Link to API information for all organization events.</dd>
<dt>events_url</dt>
<dd>URL source for event list.</dd>
<dt>current_projects</dt>
<dd>The three most recently updated <a href="#project-properties">projects</a> of this organization.</dd>
<dt>all_projects</dt>
<dd>Link to API information for all organization projects.</dd>
<dt>projects_list_url</dt>
<dd>URL source for projects list.</dd>
<dt>current_stories</dt>
<dd>Selection of current <a href="#story-properties">story dictionaries</a>.</dd>
<dt>all_stories</dt>
<dd>Link to API information for all organization stories.</dd>
<dt>rss</dt>
<dd>URL source for stories list.</dd>
</dl>
</div>
<div class="layout-minim">
<h4>Sample Request</h4>
<p><code><a href="{{ api_base }}/api/organizations/Open-Oakland">{{ api_base }}/api/organizations/Open-Oakland</a></code></p>
<h4>Sample Response</h4>
<pre><code>{
"type": "Brigade",
"name": "Open Oakland",
"id" : "Open-Oakland",
"website": "http://openoakland.org/",
"city": "Oakland, CA",
"latitude": 37.8044,
"longitude": -122.2711,
"api_url": "{{ api_base }}/api/organizations/Open-Oakland",
"started_on": "2012-12-25",
"current_events": [ … ],
"all_events": "{{ api_base }}/api/organizations/Open-Oakland/events",
"events_url": "http://www.meetup.com/OpenOakland/",
"current_projects": [ … ],
"all_projects": "{{ api_base }}/api/organizations/Open-Oakland/projects",
"projects_list_url": "https://docs.google.com/spreadsheet/pub?key=0AgNZYWcpRBQ7dHRnTUJtd3QtYkR5bk5lUmpNMDlpSEE&single=true&gid=0&output=csv",
"current_stories": [ … ],
"all_stories": "{{ api_base }}/api/organizations/Open-Oakland/stories",
"rss": ""
}</code></pre>
</div>
</div>
<div class="layout-breve">
<h2>
Projects
<a id="api-projects" href="#api-projects">¶</a>
</h2>
<div class="layout-minim">
<p>
Retrieve a list of projects. Projects are ordered by most recent update.
</p>
<h4>Endpoints</h4>
<p>
/api/projects <br>
/api/projects?param=value&param2=value2 <br>
/api/organizations/{organization id}/projects
</p>
<h4>Url parameters</h4>
<dl>
<dt>q <i>(string)</i></dt>
<dd>A search term by which results will be filtered:<br><br>
/api/projects?q=bicycle<br>
/api/organizations/Code-for-San-Francisco/projects?q=elections<br><br>
searches content of the name, description, categories, github_details and status <a href="#project-properties">properties</a>.<br><br></dd>
<dt>per_page <i>(integer)</i></dt>
<dd>The number of results to return per page:<br><br>
/api/projects?per_page=5<br><br></dd>
<dt>Project properties</dt>
<dd>You can add any of the <a href="#project-properties">Project properties</a> as a parameter and the API will filter by projects that have that property. You can also request projects based on organization properties such as:<br><br>
/api/projects?organization_type=Brigade <br>
/api/projects?organization_city=San%20Francisco,%20CA</dd>
</dl>
<h4>Response Properties</h4>
<dl>
<dt>pages</dt>
<dd>Dictionary of pagination links, optionally including <i>first</i>, <i>prev</i>, <i>next</i>, and <i>last</i>.</dd>
<dt>objects</dt>
<dd>List of <a href="#project-properties">individual projects</a>.</dd>
</dl>
</div>
<div class="layout-minim">
<h4>Sample Request</h4>
<p><code><a href="{{ api_base }}/api/projects">{{ api_base }}/api/projects</a></code></p>
<h4>Sample Response</h4>
<pre><code>{
"pages": {
"next": …,
"last": …
},
"objects": [
{
"id": 1,
"name": "cityvoice",
"link_url": "http://www.cityvoiceapp.com/",
"code_url": "https://github.com/codeforamerica/cityvoice",
"api_url": "{{ api_base }}/api/projects/1",
"categories": "community engagement, housing",
"description": "A place-based call-in system for gathering and sharing community feedback",
"github_details": { … },
"organization": { … },
"organization_name": "Code for America",
"tags": ["community engagement", "housing"],
"type": "web service",
"status": "In Progress",
"issues": [ … ],
"commit_status": "success"
},
{
"id": 2,
"name": "Adopt-a-Thingie",
…
},
…
]
}</code></pre>
<h4>Sample Request with query params</h4>
<p><code><a href="{{ api_base }}/api/projects?categories=Knowledge&organization_type=Brigade">{{ api_base }}/api/projects?categories=Knowledge&organization_type=Brigade</a></code></p>
<h4>Sample Response</h4>
<pre><code>{
"pages": {
"next": …,
"last": …
},
"objects": [
{
"id": 1,
"name": "myPhillyRising",
"link_url": "http://www.myphillyrising.com/",
"code_url": "https://github.com/openplans/myphillyrising/",
"api_url": "{{ api_base }}/api/projects/74",
"categories": "Knowledge",
"description": "myPhillyRising",
"github_details": { … },
"organization": {
"name": "Philly",
"type": "Brigade, Code for All"
},
"organization_name": "Philly",
"tags": ["neighborhoods", "news"],
"type": "",
"status": "",
"issues": [ … ],
"commit_status": "success"
},
{
"id": 2,
"name": "LocalWiki",
…
},
…
]
}</code></pre>
</div>
</div>
<div class="layout-breve">
<h2>
One Project
</h2>
<div class="layout-minim">
<p>
Retrieve a single project.
</p>
<h4>Endpoint</h4>
<p>
/api/projects/{project id}
</p>
<h4>
Project Properties
<a id="project-properties" href="#project-properties">¶</a>
</h4>
<dl>
<dt>id</dt>
<dd>Numeric ID.</dd>
<dt>name</dt>
<dd>Name.</dd>
<dt>languages</dt>
<dd>A list of programming langauges used in the project</dd>
<dt>link_url</dt>
<dd>Homepage.</dd>
<dt>code_url</dt>
<dd>Source code URL, e.g. a Github repository.</dd>
<dt>categories</dt>
<dd>String with comma-separated list of categories.</dd>
<dt>description</dt>
<dd>Prose description.</dd>
<dt>api_url</dt>
<dd>Link to complete API information for this project.</dd>
<dt>organization</dt>
<dd>Dictionary of <a href="#organization-properties">organization details</a>.</dd>
<dt>organization_name</dt>
<dd>Name of organization.</dd>
<dt>type</dt>
<dd>String type.</dd>
<dt>github_details</dt>
<dd>Dictionary of Github-specific information, for projects hosted on Github.</dd>
<dt>status</dt>
<dd>String with short description of project status.</dd>
<dt>issues</dt>
<dd>A list of project <a href="#api-issues">issues</a>.</dd>
<dt>commit_status</dt>
<dd>The status of the latest commit. <a href="https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref">More info</a></dd>
</dl>
</div>
<div class="layout-minim">
<h4>Sample Request</h4>
<p><code><a href="{{ api_base }}/api/projects/1">{{ api_base }}/api/projects/1</a></code></p>
<h4>Sample Response</h4>
<pre><code>{
"id": 1,
"name": "cityvoice",
"link_url": "http://www.cityvoiceapp.com/",
"code_url": "https://github.com/codeforamerica/cityvoice",
"api_url": "{{ api_base }}/api/projects/1",
"categories": "community engagement, housing",
"status": "In Progress",
"description": "A place-based call-in system for gathering and sharing community feedback",
"organization": { … },
"organization_name": "Code for America",
"tags": ["community engagement", "housing"],
"type": "web service",
"github_details":
{
"id": 10515516,
"contributors": [ … ],
"contributors_url": "https://api.github.com/repos/codeforamerica/cityvoice/contributors",
"created_at": "2013-06-06T00:12:30Z",
"description": "A place-based call-in system for gathering and sharing community feedback",
"forks_count": 18,
"homepage": "http://www.cityvoiceapp.com/",
"html_url": "https://github.com/codeforamerica/cityvoice",
"name": "cityvoice",
"open_issues": 38,
"owner": { … },
"participation": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 18, 13, 0, 0, 83, 20, 11, 25, 63, 66 ],
"project_needs": [],
"pushed_at": "2014-03-29T20:03:41Z",
"updated_at": "2014-03-29T20:03:41Z",
"watchers_count": 14
}
"issues": [
{
"id": 1,
"title": "Consider using Universal Analytics for Google Analytics",
"api_url": "http://codeforamerica.org/api/issues/193",
"body": "Google has officially released Universal Analytics about 2 months ago, …",
"html_url": "https://github.com/codeforamerica/cityvoice/issues/193",
"labels": [
{
"color": "84b6eb",
"name": "enhancement",
"url": "https://api.github.com/repos/codeforamerica/cityvoice/labels/enhancement"
}
],
"project": { … },
"project_name": "cityvoice",
},
{ … }
],
"languages" : [
"Python",
"CSS",
"HTML"
]
}</code></pre>
</div>
</div>
<div class="layout-breve">
<h2>
Events
<a id="api-events" href="#api-events">¶</a>
</h2>
<div class="layout-minim">
<p>
Retrieve a list of events.
</p>
<h4>Endpoints</h4>
<p>
/api/events <br>
/api/events/upcoming_events <br/>
/api/events/past_events <br/>
/api/organizations/{organization id}/events <br>
/api/organizations/{organization id}/upcoming_events <br>
/api/organizations/{organization id}/past_events
</p>
<h4>Url parameters</h4>
<dl>
<dt>per_page <i>(integer)</i></dt>
<dd>The number of results to return per page:<br><br>
/api/events?per_page=5<br><br></dd>
<dt>Event properties</dt>
<dd>You can add any of the <a href="#event-properties">Event properties</a> as a parameter and the API will filter by events that have that property. You can also request events based on organization properties such as:<br><br>
/api/events?organization_type=Brigade <br>
/api/events?organization_city=San%20Francisco,%20CA</dd>
</dl>
<h4>Response Properties</h4>
<dl>
<dt>pages</dt>
<dd>Dictionary of pagination links, optionally including <i>first</i>, <i>prev</i>, <i>next</i>, and <i>last</i>.</dd>
<dt>objects</dt>
<dd>List of <a href="#event-properties">individual events</a>.</dd>
<dt>total</dt>
<dd>The total count of objects.</dd>
</dl>
<h4>Event filters</h4>
<dt>upcoming_events</dt>
<dd>Only returns events happening presently or in the future.</dd>
<dt>past_events</dt>
<dd>Only returns events that have already ended.</dd>
</div>
<div class="layout-minim">
<h4>Sample Request</h4>
<p><code><a href="{{ api_base }}/api/events">{{ api_base }}/api/events</a></code></p>
<h4>Sample Response</h4>
<pre><code>{
"pages": {
"next": …,
"last": …
},
"objects": [
{
"id": 1,
"name": "OpenOakland Civic Hack Night",
"description": "<p>Join us for our weekly civic hack sessions inside City Hall.</p>",
"event_url": "http://www.meetup.com/OpenOakland/events/qbjtcgytdbfb/",
"api_url": "{{ api_base }}/api/events/1",
"location": null,
"start_time": "2015-02-03 18:30:00 -0800",
"end_time": null,
"organization": { … },
"organization_name": "Open Oakland",
"created_at": "2013-06-04 20:31:29"
},
{
"id": 2,
"name": "Get Out There And Do Something",
…
},
…
]
}</code></pre>
</div>
</div>
<div class="layout-breve">
<h2>
One Event
</h2>
<div class="layout-minim">
<p>
Retrieve a single event.
</p>
<h4>Endpoint</h4>
<p>
/api/events/{event id}
</p>
<h4>
Event Properties
<a id="event-properties" href="#event-properties">¶</a>
</h4>
<dl>
<dt>id</dt>
<dd>Numeric ID.</dd>
<dt>name</dt>
<dd>Name.</dd>
<dt>description</dt>
<dd>Description.</dd>
<dt>event_url</dt>
<dd>Link to page about event.</dd>
<dt>api_url</dt>
<dd>Link to complete API information for this event.</dd>
<dt>location</dt>
<dd>Optional location. Sometimes missing, and must be found in description.</dd>
<dt>start_time</dt>
<dd>Start time. In <q><code>YYYY-MM-DD HH:MM:SS ZZZZ</code></q> format, local to event if possible.</dd>
<dt>end_time</dt>
<dd>Optional end time. In <q><code>YYYY-MM-DD HH:MM:SS ZZZZ</code></q> format, local to event if possible.</dd>
<dt>organization</dt>
<dd>Dictionary of <a href="#organization-properties">organization details</a>.</dd>
<dt>organization_name</dt>
<dd>Name of organization.</dd>
</dl>
</div>
<div class="layout-minim">
<h4>Sample Request</h4>
<p><code><a href="{{ api_base }}/api/events/1">{{ api_base }}/api/events/1</a></code></p>
<h4>Sample Response</h4>
<pre><code>{
"id": 1,
"name": "OpenOakland Civic Hack Night",
"description": "<p>Join us for our weekly civic hack sessions inside City Hall.</p>",
"event_url": "http://www.meetup.com/OpenOakland/events/qbjtcgytdbfb/",
"api_url": "{{ api_base }}/api/events/1",
"location": null,
"start_time": "2015-02-03 18:30:00 -0800",
"end_time": null,
"organization": { … },
"organization_name": "Open Oakland",
"created_at": "2013-06-04 20:31:29"
}</code></pre>
</div>
</div>
<div class="layout-breve">
<h2>
Stories
<a id="api-stories" href="#api-stories">¶</a>
</h2>
<div class="layout-minim">
<p>
Retrieve a list of stories.
</p>
<h4>Endpoints</h4>
<p>
/api/stories <br>
/api/organizations/{organization id}/stories
</p>
<h4>Url parameters</h4>
<dl>
<dt>per_page <i>(integer)</i></dt>
<dd>The number of results to return per page:<br><br>
/api/stories?per_page=5<br><br></dd>
<dt>Story properties</dt>
<dd>You can add any of the <a href="#story-properties">Story properties</a> as a parameter and the API will filter by stories that have that property. You can also request stories based on organization properties such as:<br><br>
/api/events?organization_type=Brigade <br>
/api/events?organization_city=San%20Francisco,%20CA</dd>
</dl>
<h4>Response Properties</h4>
<dl>
<dt>pages</dt>
<dd>Dictionary of pagination links, optionally including <i>first</i>, <i>prev</i>, <i>next</i>, and <i>last</i>.</dd>
<dt>objects</dt>
<dd>List of <a href="#story-properties">individual stories</a>.</dd>
</dl>
</div>
<div class="layout-minim">
<h4>Sample Request</h4>
<p><code><a href="{{ api_base }}/api/stories">{{ api_base }}/api/stories</a></code></p>
<h4>Sample Response</h4>
<pre><code>{
"pages": {
"next": …,
"last": …
},
"objects": [
{
"id": 1,
"title": "Here Are Our Values",
"link": "http://www.codeforamerica.org/blog/2014/03/27/here-are-our-values/",
"organization": { … },
"organization_name": "Code for San Francisco",
"type": "blog"
},
{
"id": 2,
"name": "Get Out There And Do Something",
…
},
…
]
}</code></pre>
</div>
</div>
<div class="layout-breve">
<h2>
One Story
</h2>
<div class="layout-minim">
<p>
Retrieve a single story.
</p>
<h4>Endpoint</h4>
<p>
/api/stories/{story id}
</p>
<h4>
Story Properties
<a id="story-properties" href="#story-properties">¶</a>
</h4>
<dl>
<dt>id</dt>
<dd>Numeric ID.</dd>
<dt>title</dt>
<dd>Title.</dd>
<dt>link</dt>
<dd>Link.</dd>
<dt>organization</dt>
<dd>Dictionary of <a href="#organization-properties">organization details</a>.</dd>
<dt>organization_name</dt>
<dd>Name of organization.</dd>
<dt>type</dt>
<dd>Type of story</dd>
</dl>
</div>
<div class="layout-minim">
<h4>Sample Request</h4>
<p><code><a href="{{ api_base }}/api/stories/1">{{ api_base }}/api/stories/1</a></code></p>
<h4>Sample Response</h4>
<pre><code>{
"id": 1,
"title": "Here Are Our Values",
"link": "http://www.codeforamerica.org/blog/2014/03/27/here-are-our-values/",
"organization": { … },
"organization_name": "Code for San Francisco",
"type": "blog"
}</code></pre>
</div>
</div>
<div class="layout-breve">
<h2>
Issues
<a id="api-issues" href="#api-issues">¶</a>
</h2>
<div class="layout-minim">
<p>
Retrieve a list of project issues.
</p>
<h4>Endpoints</h4>
<p>
/api/issues <br>
/api/issues/labels/{label name(s)}
</p>
<h4>Url parameters</h4>
<dl>
<dt>per_page <i>(integer)</i></dt>
<dd>The number of results to return per page:<br><br>
/api/issues?per_page=5<br><br></dd>
<dt>Issue properties</dt>
<dd>You can add any of the <a href="#issue-properties">Issue properties</a> as a parameter and the API will filter by issues that have that property. You can also request issues based on organization properties such as:<br><br>
/api/issues?organization_type=Brigade<br>
/api/issues?organization_city=San%20Francisco,%20CA<br><br>
Or by project properties such as:<br><br>
/api/issues?project_name=communities<br>
/api/issues?project_status=beta<br></dd>
</dl>
<h4>Response Properties</h4>
<dl>
<dt>pages</dt>
<dd>Dictionary of pagination links, optionally including <i>first</i>, <i>prev</i>, <i>next</i>, and <i>last</i>.</dd>
<dt>objects</dt>
<dd>List of <a href="#issue-properties">individual issues</a>.</dd>
</dl>
<h4>Issue filters</h4>
<dt>labels (comma separated)</dt>
<dd>Return issues that have at least one of the given labels</dd>
</div>
<div class="layout-minim">
<h4>Sample Request</h4>
<p><code><a href="{{ api_base }}/api/issues">{{ api_base }}/api/issues</a></code></p>
<h4>Sample Response</h4>
<pre><code>{
"pages": {
"next": …,
"last": …
},
"objects": [
{
"id": 1,
"title": "Write some tests",
"api_url": "http://codeforamerica.org/api/issues/2",
"body": "Start writing tests. ",
"html_url": "https://github.com/sfbrigade/ballot_initiatives/issues/7",
"labels": [
{
"color": "84b6eb",
"name": "enhancement",
"url": "https://api.github.com/repos/sfbrigade/ballot_initiatives/labels/enhancement"
}
],
"project": { … },
"project_name": "ballot_initiatives",
},
{
"id": 2,
"title": "Import SFGOV data set",
…
},
…
]
}</code></pre>
<h4>Sample Request with labels filter</h4>
<p><code><a href="{{ api_base }}/api/issues/labels/enhancement">{{ api_base }}/api/issues/labels/enhancement</a></code></p>
<h4>Sample Response</h4>
<pre><code>{
"pages": {
"next": …,
"last": …
},
"objects": [
{
"id": 1,
"title": "Write some tests",
"api_url": "http://codeforamerica.org/api/issues/2",
"body": "Start writing tests. ",
"html_url": "https://github.com/sfbrigade/ballot_initiatives/issues/7",
"labels": [
{
"color": "84b6eb",
"name": "enhancement",
"url": "https://api.github.com/repos/sfbrigade/ballot_initiatives/labels/enhancement"
}
],
"project": { … },
"project_name": "ballot_initiatives",
},
{
"id": 2,
"title": "help for non-service residents",
"labels": [
{
"color": "84b6eb",
"name": "enhancement",
"url": "https://api.github.com/repos/open-austin/austin-recycles/labels/enhancement"
},
{
"color": "fef2c0",
"name": "hack",
"url": "https://api.github.com/repos/open-austin/austin-recycles/labels/hack"
}
]
…
},
…
]
}</code></pre>
<h4>Sample Request with Parameters</h4>
<p><code><a href="{{ api_base }}/api/issues?organization_type=Code for All">{{ api_base }}/api/issues?organization_type=Code for All</a></code></p>
<h4>Sample Response</h4>
<pre><code>[
{
api_url: "http://localhost:5000/api/issues/27",
body: "",
html_url: "https://github.com/CfABrigadePhiladelphia/laddr/issues/34",
id: 27,
labels: [ ... ],
project: { ... },
title: "create admin UI on profile page for promoting other users' account level"
}
, ...
]</code></pre>
</div>
</div>
<div class="layout-breve">
<h2>
One Issue
</h2>
<div class="layout-minim">
<p>
Retrieve a single issue.
</p>
<h4>Endpoint</h4>
<p>
/api/issues/{issue id}
</p>
<h4>
Issue Properties
<a id="issue-properties" href="#issue-properties">¶</a>
</h4>
<dl>
<dt>id</dt>
<dd>Numeric ID.</dd>
<dt>title</dt>
<dd>Title.</dd>
<dt>body</dt>
<dd>Body.</dd>
<dt>api_url</dt>
<dd>API URL.</dd>
<dt>html_url</dt>
<dd>Github URL.</dd>
<dt>labels</dt>
<dd>Array of issue labels dictionaries</dd>
<dt>project_name</dt>
<dd>Name of project</dd>
<dt>project</dt>
<dd>Dictionary of <a href="#project-properties">project details</a>.</dd>
</dl>
</div>
<div class="layout-minim">
<h4>Sample Request</h4>
<p><code><a href="{{ api_base }}/api/issues/1">{{ api_base }}/api/issues/1</a></code></p>
<h4>Sample Response</h4>
<pre><code>{
"id": 1,
"title": "Write some tests",
"api_url": "http://codeforamerica.org/api/issues/2",
"body": "Start writing tests. ",
"html_url": "https://github.com/sfbrigade/ballot_initiatives/issues/7",
"labels": [
{
"color": "84b6eb",
"name": "enhancement",
"url": "https://api.github.com/repos/sfbrigade/ballot_initiatives/labels/enhancement"
}
],
"project": { … },
"project_name": "ballot_initiatives",
}</code></pre>
</div>
</div>
</body>
</html>