Skip to content

Commit 059ed72

Browse files
Fix Readme errors
1 parent b2b12e1 commit 059ed72

File tree

1 file changed

+39
-11
lines changed

1 file changed

+39
-11
lines changed

README.md

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ response = client.connect('bofa', {
9191
})
9292

9393
if response.ok:
94-
content = json.loads(response.content)
94+
user = response.json()
9595
else:
9696
# handle non-20x status codes
9797
```
@@ -107,8 +107,8 @@ from plaid.utils import json
107107

108108

109109
client = Client()
110-
institutions = json.loads(client.institutions().content)
111-
categories = json.loads(client.categories().content)
110+
institutions = client.institutions().json()
111+
categories = client.categories().json()
112112
```
113113

114114
### Authenticated Endpoints
@@ -134,7 +134,7 @@ try:
134134
except plaid_errors.PlaidError:
135135
pass
136136
else:
137-
connect_data = json.loads(response.content)
137+
connect_data = response.json()
138138
```
139139

140140
### MFA add Connect User
@@ -158,11 +158,11 @@ except plaid_errors.PlaidError, e:
158158
else:
159159
if response.status_code == 200:
160160
# User connected
161-
data = json.loads(response.content)
161+
data = response.json()
162162
elif response.stat_code == 201:
163163
# MFA required
164164
try:
165-
mfa_response = answer_mfa(json.loads(response.content))
165+
mfa_response = answer_mfa(response.json())
166166
except plaid_errors.PlaidError, e:
167167
pass
168168
else:
@@ -281,7 +281,7 @@ User previously Auth-ed
281281

282282
```python
283283
client = Client(client_id='***', secret='***', access_token='usertoken')
284-
accounts = json.loads(client.auth_get().content)
284+
accounts = client.auth_get().json()
285285
```
286286

287287
### Get Account Balances
@@ -295,14 +295,42 @@ response = client.balance()
295295

296296
### Get Transactions
297297

298-
User previously Connected-ed
298+
User previously Connect-ed
299299

300300
```python
301301
client = Client(client_id='***', secret='***', access_token='usertoken')
302302
response = client.connect_get()
303-
json.loads(response.content)
303+
transactions = response.json()
304304
```
305305

306+
### Get Info
307+
308+
User previously Info-ed
309+
310+
```python
311+
client = Client(client_id='***', secret='***', access_token='usertoken')
312+
response = client.info_get()
313+
info = response.json()
314+
```
315+
316+
### Get Income
317+
318+
User previously Income-ed
319+
320+
```python
321+
client = Client(client_id='***', secret='***', access_token='usertoken')
322+
response = client.income_get()
323+
income = response.json()
324+
```
325+
### Get Risk
326+
327+
User previously Risk-ed
328+
329+
```python
330+
client = Client(client_id='***', secret='***', access_token='usertoken')
331+
response = client.risk_get()
332+
risk = response.json()
333+
```
306334
## Attribution & Maintenance
307335

308336
This repository was originally authored by [Chris Forrette](https://github.com/chrisforrette).
@@ -327,8 +355,8 @@ $ make test
327355
[MIT][6]
328356

329357
[1]: https://plaid.com
330-
[2]: https://plaid.com/docs
331-
[3]: https://plaid.com/docs/#response-codes
358+
[2]: https://plaid.com/docs/api
359+
[3]: https://plaid.com/docs/api/#response-codes
332360
[4]: https://github.com/plaid/link
333361
[5]: https://github.com/plaid/plaid-python/issues/new
334362
[6]: https://github.com/plaid/plaid-python/blob/master/LICENSE

0 commit comments

Comments
 (0)