Skip to content

Commit 7d6ea10

Browse files
committed
started to think about balancing gets and puts
1 parent 091a8e9 commit 7d6ea10

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

proposals/drafts/reconciliation.rst

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,45 @@ API
6969

7070
:query name: a name of the politician
7171
:query jurisdiction_id: an OCD id for the jurisdiction of the organization that the politician is seeking election into or is a member of
72-
:query office: (optional) a name of the office
72+
:query role: (optional) a name of the role associated with a post
73+
:query active_date: (optional) a date, date range, year, year range
74+
when the politician was seeking or held this
75+
role
76+
:query post_label: the label of the post
7377
:query birth_date: (optional) the birth date of the politician
74-
:query active_date: (optional) a date, date range, year, year range when the politician was seeking or held this office
7578
:status 200 OK: no error, returns a list of possible ids with match scores
7679
:status 404 Not Found: could not find any possible matches
80+
:status 402 Payment required: If the balance between data added (puts and posts on `/identifier`) and searches is out of wack. This reduce
81+
:status 429 Too Many Requests: Rate limiting
82+
83+
:reqheader Authorization: optional OAuth token to authenticate
84+
:resheader Balance: Balance between data added and data searched
85+
86+
87+
**Example request**:
88+
89+
.. sourcecode:: http
90+
91+
GET /search?jurisdiction_id=ocd-jurisdiction/country:us/state:il/place:chicago/government&name="Ed Burke" HTTP/1.1
92+
Host: example.com
93+
Accept: application/json, text/javascript
94+
95+
**Example response**:
96+
97+
.. sourcecode:: http
98+
99+
HTTP/1.1 200 OK
100+
Vary: Accept
101+
Content-Type: text/javascript
102+
103+
[{"politician": {"jurisdiction_id": "ocd-jurisdiction/country:us/state:il/place:chicago/government",
104+
"name": "Ed Burke",
105+
"ocd_id": "ocd-person/912c8ddf-8d04-4f7f-847d-2daf84e096e2"
106+
"birth_date": null,
107+
"posts": {"role": "Alderman", "label": "Ward 3"}
108+
},
109+
"match_score": 0.74}
110+
]
77111

78112
.. http:get:: /identifier/(str:ocd_identifier)
79113

0 commit comments

Comments
 (0)