You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api.md
+29-3Lines changed: 29 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,39 @@
1
1
# API Documentation
2
2
3
3
## Submitting Patient Record
4
-
5
-
Submit a patient record and retrieve the estimated risk of having elevated blood-lead levels.
4
+
5
+
### Authentication
6
+
7
+
Submitting patient records to Lead Safe requires client credentials to retrieve a token, which is required for all API calls. City of Chicago will issue a client ID and a client secret ID which will be used to obtain a token.
8
+
9
+
10
+
```bash
11
+
GET --user CLIENT_ID:CLIENT_SECRET --data "grant_type=client_credentials"<url>/oauth/token
12
+
```
13
+
14
+
Successful requests for a token will return a JSON file similar to this:
Tokens are set to expire every 3,600 seconds (1 hour) and a new token will need to be obtained.
21
+
22
+
To upload a patient record, the POST command must include a header called `Authorization: Bearer` followed by the TOKEN obtained in the previous steps.
23
+
24
+
An upload would look like:
6
25
7
26
```bash
8
-
POST {json file} <url>/insert/
27
+
POST --header "Content-Type:application/json" --header "Authorization: Bearer TOKEN" FILE.JSON <url>/upload/insert/
9
28
```
10
29
30
+
The format for `FILE.JSON` is described in the next section.
31
+
32
+
### Schema
33
+
34
+
Submit a patient record and retrieve the estimated risk of having elevated blood-lead levels.
0 commit comments