budgea_client 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +488 -249
- data/budgea_openapi.json +22079 -0
- data/lib/budgea_client/models/bank.rb +27 -27
- data/lib/budgea_client/models/field.rb +63 -52
- data/lib/budgea_client/version.rb +1 -1
- data/pkg/budgea_client-1.1.0.gem +0 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5051409d228f8d245f773d7171b4e4904359e850004c066f76b7672e37f4f2c0
|
4
|
+
data.tar.gz: 7151b2f797ffc867c16ea633e6771a932dc49155d9f611bf1aed9ec14b0a5b3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9358e14a639142338701ab89a7a76afc94748d30e6632e98f6f0713f68171c711621b8c20600b69339199672a3e43fe57a4773cebcc6e2eb1c54ad5302c04460
|
7
|
+
data.tar.gz: 3d5d7d5467e96d5fc2ee7346d1b7478817562373a4c4c47d24d44d4e23f2960ba67408757a5b7f1d3312de37517bd3cc96c65ff9928a0c09175a2690bbb1264f
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -5,13 +5,13 @@ BudgeaClient - the Ruby gem for the Budgea API Documentation
|
|
5
5
|
# Budgea Development Guides
|
6
6
|
|
7
7
|
Welcome to **Budgea**'s documentation.
|
8
|
-
This documentation is intended to get you up-and-running with our APIs and advise on the implementation of some
|
8
|
+
This documentation is intended to get you up-and-running with our APIs and advise on the implementation of some
|
9
9
|
regulatory aspects of your application, following the DSP2's guidelines.
|
10
10
|
## Getting Started **IMPORTANT** Depending on your status with regard of the DSP2 regulation, **agent** or **partner**,
|
11
11
|
you may call our APIs or simply use our Webview and callbacks to get the financial data of your users. As an **agent**,
|
12
12
|
you are allowed to call directly our APIs and implement your own form to get the user's credentials. As a **partner**,
|
13
13
|
you cannot manipulate the credentials, and have to delegate this step to us through our webview.
|
14
|
-
|
14
|
+
|
15
15
|
The sections below will document how to use our APIs, make sure you have the **agent** status to do so. For the
|
16
16
|
**partner**, please refer to the section *Webview* and *Callbacks* of this documentation.
|
17
17
|
|
@@ -38,14 +38,14 @@ thanks to the query parameter `expand`.
|
|
38
38
|
To get more interesting things done, you'll need to send authenticated requests.
|
39
39
|
|
40
40
|
### Authentication
|
41
|
-
The way to authenticate is by passing the `Authorization: Bearer <token>` header in your request. At the setup
|
41
|
+
The way to authenticate is by passing the `Authorization: Bearer <token>` header in your request. At the setup
|
42
42
|
a _manage token_ have been generated, you can use this token for now, when creating your user we'll see how to
|
43
43
|
generate a user's token.
|
44
44
|
``` curl -X GET \\
|
45
45
|
https://demo.biapi.pro/2.0/config \\
|
46
46
|
-H 'Authorization: Bearer <token>'
|
47
47
|
```
|
48
|
-
|
48
|
+
|
49
49
|
This endpoint will list all the parameters you can change to adapt Budgea to your needs.
|
50
50
|
We've covered the very first calls. Before diving deeper, let's see some general information about the APIs.
|
51
51
|
|
@@ -64,8 +64,8 @@ Data format: **application/json** ([http://www.json.org](http://www.json.org/))
|
|
64
64
|
### Resources
|
65
65
|
Each call on an endpoint will return resources. The main resources are:
|
66
66
|
|
67
|
-
| Resource | Description |
|
68
|
-
|---------------------|:------------------------------------------------------------------------------------------------------------------ |
|
67
|
+
| Resource | Description |
|
68
|
+
|---------------------|:------------------------------------------------------------------------------------------------------------------ |
|
69
69
|
|Users | Represent a user |
|
70
70
|
|Connection | A set of data used to authenticate on a website (usually a login and password). There is 1 connection for each website|
|
71
71
|
|Account | A bank account contained in a connection |
|
@@ -75,42 +75,42 @@ Each call on an endpoint will return resources. The main resources are:
|
|
75
75
|
The chain of resources is as follow: **Users ∈ Connections ∈ Accounts ∈ Transactions or Investments**
|
76
76
|
|
77
77
|
### RESTful API
|
78
|
-
This API is RESTful, which means it is stateless and each resource is accessed with an uniq URI.
|
78
|
+
This API is RESTful, which means it is stateless and each resource is accessed with an uniq URI.
|
79
79
|
|
80
80
|
Several HTTP methods are available:
|
81
81
|
|
82
|
-
| Method | Description |
|
83
|
-
| ------------------------|:-------------------------------|
|
84
|
-
| GET /resources | List resources |
|
85
|
-
| GET /resources/{ID} | Get a resource from its ID |
|
86
|
-
| POST /resources | Create a new resource |
|
87
|
-
| POST /resources/{ID} | Update a resource |
|
88
|
-
| PUT /resources /{ID} | Update a resource |
|
89
|
-
| DELETE /resources | Remove every resources |
|
82
|
+
| Method | Description |
|
83
|
+
| ------------------------|:-------------------------------|
|
84
|
+
| GET /resources | List resources |
|
85
|
+
| GET /resources/{ID} | Get a resource from its ID |
|
86
|
+
| POST /resources | Create a new resource |
|
87
|
+
| POST /resources/{ID} | Update a resource |
|
88
|
+
| PUT /resources /{ID} | Update a resource |
|
89
|
+
| DELETE /resources | Remove every resources |
|
90
90
|
| DELETE /resources/{ID} | Delete a resource |
|
91
91
|
|
92
92
|
Each resource can contain sub-resources, for example: `/users/me/connections/2/accounts/23/transactions/48`
|
93
93
|
|
94
94
|
### HTTP response codes
|
95
95
|
|
96
|
-
| Code | Message | Description |
|
97
|
-
| ----------- |:---------------------:|-----------------------------------------------------------------------------------------------|
|
98
|
-
| 200 | OK |Default response when a GET or POST request has succeed |
|
99
|
-
| 202 | Accepted |For a new connection this code means it is necessary to provide complementary information (2FA)|
|
100
|
-
| 204 | No content |Default response when a POST request succeed without content |
|
101
|
-
| 400 | Bad request |Supplied parameters are incorrect |
|
102
|
-
| 403 | Forbidden |Invalid token |
|
103
|
-
| 500 | Internal Servor Error |Server error |
|
104
|
-
| 503 | Service Unavailable |Service is temporarily unavailable |
|
96
|
+
| Code | Message | Description |
|
97
|
+
| ----------- |:---------------------:|-----------------------------------------------------------------------------------------------|
|
98
|
+
| 200 | OK |Default response when a GET or POST request has succeed |
|
99
|
+
| 202 | Accepted |For a new connection this code means it is necessary to provide complementary information (2FA)|
|
100
|
+
| 204 | No content |Default response when a POST request succeed without content |
|
101
|
+
| 400 | Bad request |Supplied parameters are incorrect |
|
102
|
+
| 403 | Forbidden |Invalid token |
|
103
|
+
| 500 | Internal Servor Error |Server error |
|
104
|
+
| 503 | Service Unavailable |Service is temporarily unavailable |
|
105
105
|
|
106
|
-
### Errors management
|
106
|
+
### Errors management
|
107
107
|
|
108
108
|
In case an error occurs (code 4xx or 5xx), the response can contain a JSON object describing this error:
|
109
109
|
|
110
110
|
```json
|
111
|
-
{
|
111
|
+
{
|
112
112
|
"code": "authFailure",
|
113
|
-
"message": "Wrong password" // Optional
|
113
|
+
"message": "Wrong password" // Optional
|
114
114
|
}
|
115
115
|
```
|
116
116
|
|
@@ -120,20 +120,20 @@ errors is listed further down this page.
|
|
120
120
|
### Authentication
|
121
121
|
A user is authenticated by an access_token which is sent by the API during a call on one of the
|
122
122
|
authentication services, and can be supplied with this header: `Authorization: Bearer YYYYYYYYYYYYYYYYYYYYYYYYYYY`
|
123
|
-
There are two user levels:
|
124
|
-
* Normal user, which can only access to his own accounts
|
123
|
+
There are two user levels:
|
124
|
+
* Normal user, which can only access to his own accounts
|
125
125
|
* Administrator, with extended rights
|
126
126
|
|
127
127
|
### Default filters
|
128
128
|
|
129
129
|
During a call to an URI which lists resources, some filters can be passed as query parameters:
|
130
130
|
|
131
|
-
| Parameter | Type | Description |
|
132
|
-
| ----------- |:---------:|-----------------------------------------------------------|
|
133
|
-
| offset | Integer |Offset of the first returned resource |
|
134
|
-
| limit | Integer |Limit number of results |
|
135
|
-
| min_date | Date |Minimal date (if supported by service), format: YYYY-MM-DD |
|
136
|
-
| max_date | Date |Maximal date (if supported by service), format: YYYY-MM-DD |
|
131
|
+
| Parameter | Type | Description |
|
132
|
+
| ----------- |:---------:|-----------------------------------------------------------|
|
133
|
+
| offset | Integer |Offset of the first returned resource |
|
134
|
+
| limit | Integer |Limit number of results |
|
135
|
+
| min_date | Date |Minimal date (if supported by service), format: YYYY-MM-DD |
|
136
|
+
| max_date | Date |Maximal date (if supported by service), format: YYYY-MM-DD |
|
137
137
|
|
138
138
|
### Extend requests
|
139
139
|
|
@@ -141,7 +141,7 @@ During a GET on a set of resources or on a unique resource, it is possible to ad
|
|
141
141
|
to extend relations with other resources:
|
142
142
|
|
143
143
|
`GET /2.0/users/me/accounts/123?expand=transactions[category],connection`
|
144
|
-
|
144
|
+
|
145
145
|
```json
|
146
146
|
{
|
147
147
|
"id": 123,
|
@@ -182,276 +182,515 @@ Authorization: Bearer <token>
|
|
182
182
|
```
|
183
183
|
|
184
184
|
```http
|
185
|
-
HTTP/1.1 200 OK
|
186
|
-
Content-Type: application/json
|
187
|
-
Content-Length: 3026
|
188
|
-
Server: Apache
|
189
|
-
Date: Fri, 14 Mar 2014 08:24:02 GMT
|
190
|
-
{ \"banks\" : [ { \"id_weboob\" : \"bnporc\", \"name\" : \"BNP Paribas\", \"id\" : 3, \"hidden\" : false, \"fields\" : [ { \"id\" : 1, \"id_bank\" : 3, \"regex\" : \"^[0-9]{5,10}$\", \"name\" : \"login\", \"type\" : \"text\", \"label\" : \"Numéro client\" }, { \"id\" : 2, \"id_bank\" : 3, \"regex\" : \"^[0-9]{6}$\", \"name\" : \"password\", \"type\" : \"password\", \"label\" : \"Code secret\" } ] }, ... ] \"total\" : 41 }
|
185
|
+
HTTP/1.1 200 OK
|
186
|
+
Content-Type: application/json
|
187
|
+
Content-Length: 3026
|
188
|
+
Server: Apache
|
189
|
+
Date: Fri, 14 Mar 2014 08:24:02 GMT
|
190
|
+
{ \"banks\" : [ { \"id_weboob\" : \"bnporc\", \"name\" : \"BNP Paribas\", \"id\" : 3, \"hidden\" : false, \"fields\" : [ { \"id\" : 1, \"id_bank\" : 3, \"regex\" : \"^[0-9]{5,10}$\", \"name\" : \"login\", \"type\" : \"text\", \"label\" : \"Numéro client\" }, { \"id\" : 2, \"id_bank\" : 3, \"regex\" : \"^[0-9]{6}$\", \"name\" : \"password\", \"type\" : \"password\", \"label\" : \"Code secret\" } ] }, ... ] \"total\" : 41 }
|
191
191
|
```
|
192
192
|
|
193
193
|
### Constants
|
194
194
|
|
195
|
-
#### List of bank account types
|
196
|
-
|
197
|
-
| Type |Description |
|
198
|
-
| ----------- |-----------------------------------|
|
199
|
-
| checking |Checking account |
|
200
|
-
| savings |Savings account |
|
201
|
-
| deposit |Deposit accounts |
|
202
|
-
| loan |Loan |
|
203
|
-
| market | Market accounts |
|
204
|
-
| joint |Joint account |
|
205
|
-
| card |Card |
|
206
|
-
| lifeinsurance |Life insurance accounts |
|
207
|
-
| pee |Plan Épargne Entreprise |
|
208
|
-
| perco |Plan Épargne Retraite |
|
209
|
-
| article83 |Article 83 |
|
210
|
-
| rsp |Réserve spéciale de participation |
|
211
|
-
| pea |Plan d'épargne en actions |
|
212
|
-
| capitalisation|Contrat de capitalisation |
|
213
|
-
| perp |Plan d'épargne retraite populaire |
|
214
|
-
| madelin |Contrat retraite Madelin |
|
215
|
-
| unknown |Inconnu |
|
216
|
-
|
217
|
-
#### List of transaction types
|
218
|
-
|
219
|
-
| Type |Description |
|
220
|
-
| ----------- |-----------------------------------|
|
221
|
-
|transfer |Transfers |
|
222
|
-
|order |Orders |
|
223
|
-
|check |Checks |
|
224
|
-
|deposit |Cash deposit |
|
225
|
-
|payback |Payback |
|
226
|
-
|withdrawal |Withdrawal |
|
227
|
-
|loan_payment |Loan payment |
|
228
|
-
|bank |Bank fees |
|
229
|
-
|card |Card operation |
|
230
|
-
|deferred_card |Deferred card operation |
|
231
|
-
|card_summary |Mensual debit of a deferred card |
|
232
|
-
|
233
|
-
#### List of synchronization errors
|
234
|
-
|
235
|
-
| Error |Description |
|
236
|
-
| ----------------------- |------------------------------------------------------------------------------------- |
|
237
|
-
|wrongpass |The authentication on website has failed |
|
238
|
-
|additionalInformationNeeded |Additional information are needed |
|
239
|
-
|websiteUnavailable |The website is unavailable |
|
240
|
-
|actionNeeded |An action is needed on the website |
|
241
|
-
|bug |A bug has occurred during the synchronization. An alert has been sent to Budget Insight|
|
242
|
-
|
243
|
-
Now you know the basics of Budgea API
|
244
|
-
- Basic call to retrieve resources
|
245
|
-
- Add query parameters to aplly filters
|
246
|
-
- Expand resources
|
247
|
-
- Authenticated calls
|
248
|
-
|
249
|
-
We're good for the basics! Now let's see how to integrate Budgea in your app and create your first user.
|
250
|
-
|
251
|
-
## Integrate Budgea
|
252
|
-
|
253
|
-
### The workflow Users of your application exist in the Budgea API.
|
254
|
-
Every User is identified by an access_token which is the shared secret between your application and our API.
|
255
|
-
The workflow is as below:
|
256
|
-
|
257
|
-
1. The user is on your application and wants to share his bank accounts or invoices.
|
258
|
-
2. A call is made **client side** (browser's javascript or desktop application) to create a temporarily token which will be used to make API calls.
|
259
|
-
3. A form is built, allowing the user to select the connector to use (bank or provider, depending on context). Every connector requires different kind of credentials.
|
260
|
-
4. A call on the API is made with the temporarily token to add a **Connection** with the credentials supplied by user.
|
261
|
-
5. In case of success, the user chooses what bank accounts (**Account**) or subscriptions (**Subscription**) he wants to share with your application.
|
262
|
-
6. When he validates the share, the temporarily token is transmitted to your server.
|
195
|
+
#### List of bank account types
|
196
|
+
|
197
|
+
| Type |Description |
|
198
|
+
| ----------- |-----------------------------------|
|
199
|
+
| checking |Checking account |
|
200
|
+
| savings |Savings account |
|
201
|
+
| deposit |Deposit accounts |
|
202
|
+
| loan |Loan |
|
203
|
+
| market | Market accounts |
|
204
|
+
| joint |Joint account |
|
205
|
+
| card |Card |
|
206
|
+
| lifeinsurance |Life insurance accounts |
|
207
|
+
| pee |Plan Épargne Entreprise |
|
208
|
+
| perco |Plan Épargne Retraite |
|
209
|
+
| article83 |Article 83 |
|
210
|
+
| rsp |Réserve spéciale de participation |
|
211
|
+
| pea |Plan d'épargne en actions |
|
212
|
+
| capitalisation|Contrat de capitalisation |
|
213
|
+
| perp |Plan d'épargne retraite populaire |
|
214
|
+
| madelin |Contrat retraite Madelin |
|
215
|
+
| unknown |Inconnu |
|
216
|
+
|
217
|
+
#### List of transaction types
|
218
|
+
|
219
|
+
| Type |Description |
|
220
|
+
| ----------- |-----------------------------------|
|
221
|
+
|transfer |Transfers |
|
222
|
+
|order |Orders |
|
223
|
+
|check |Checks |
|
224
|
+
|deposit |Cash deposit |
|
225
|
+
|payback |Payback |
|
226
|
+
|withdrawal |Withdrawal |
|
227
|
+
|loan_payment |Loan payment |
|
228
|
+
|bank |Bank fees |
|
229
|
+
|card |Card operation |
|
230
|
+
|deferred_card |Deferred card operation |
|
231
|
+
|card_summary |Mensual debit of a deferred card |
|
232
|
+
|
233
|
+
#### List of synchronization errors
|
234
|
+
|
235
|
+
| Error |Description |
|
236
|
+
| ----------------------- |------------------------------------------------------------------------------------- |
|
237
|
+
|wrongpass |The authentication on website has failed |
|
238
|
+
|additionalInformationNeeded |Additional information are needed |
|
239
|
+
|websiteUnavailable |The website is unavailable |
|
240
|
+
|actionNeeded |An action is needed on the website |
|
241
|
+
|bug |A bug has occurred during the synchronization. An alert has been sent to Budget Insight|
|
242
|
+
|
243
|
+
Now you know the basics of Budgea API
|
244
|
+
- Basic call to retrieve resources
|
245
|
+
- Add query parameters to aplly filters
|
246
|
+
- Expand resources
|
247
|
+
- Authenticated calls
|
248
|
+
|
249
|
+
We're good for the basics! Now let's see how to integrate Budgea in your app and create your first user.
|
250
|
+
|
251
|
+
## Integrate Budgea
|
252
|
+
|
253
|
+
### The workflow Users of your application exist in the Budgea API.
|
254
|
+
Every User is identified by an access_token which is the shared secret between your application and our API.
|
255
|
+
The workflow is as below:
|
256
|
+
|
257
|
+
1. The user is on your application and wants to share his bank accounts or invoices.
|
258
|
+
2. A call is made **client side** (browser's javascript or desktop application) to create a temporarily token which will be used to make API calls.
|
259
|
+
3. A form is built, allowing the user to select the connector to use (bank or provider, depending on context). Every connector requires different kind of credentials.
|
260
|
+
4. A call on the API is made with the temporarily token to add a **Connection** with the credentials supplied by user.
|
261
|
+
5. In case of success, the user chooses what bank accounts (**Account**) or subscriptions (**Subscription**) he wants to share with your application.
|
262
|
+
6. When he validates the share, the temporarily token is transmitted to your server.
|
263
263
|
|
264
264
|
This one will call the Budgea API with this token to get a permanent token.
|
265
265
|
|
266
266
|
**Note** In case your application works without a server (for example a desktop application), the permanent token can
|
267
|
-
be obtained on the 1st step, by supplying a client_secret to /autinit and the step 6 is omitted. To get more
|
268
|
-
information, read the protocol. There are 3 steps to integrate Budgea in your application:
|
269
|
-
1. Provide a way for your users to share their credentials with you
|
270
|
-
2. Get the data scraped from Budgea
|
271
|
-
3. Be sure to follow the good practices before going into production
|
272
|
-
|
273
|
-
### Get credentials from users
|
274
|
-
You have 2 options here:
|
275
|
-
- Integrate the Budget Insight's Webview, a turnkey solution to get user's credentials
|
276
|
-
- Create your own form following the protocol (must have the *agent* status)
|
277
|
-
|
278
|
-
#### Webview
|
279
|
-
|
280
|
-
The webview allows your users to give their bank or provider credentials to the safety third-party Budgea API.
|
281
|
-
It is responsive, which means it displays correctly on a desktop or a mobile device.
|
282
|
-
The API meets the standard [OAuth 2](http://tools.ietf.org/html/rfc6749) and any client library that implements it will
|
283
|
-
be able to facilitate the integration to the Budgea API. We provide PHP, Python and Ruby modules to facilitate the
|
284
|
-
integration.
|
285
|
-
|
286
|
-
|Language | Library |
|
287
|
-
|-----------------|---------------------------------------------------------------------------------------- |
|
288
|
-
|PHP |[BudgeaAPI.php](https://github.com/budgetinsight/budgea-clients/blob/master/BudgeaAPI.php)|
|
289
|
-
|PYTHON |[budgea_api.py](https://github.com/budgetinsight/budgea-clients/blob/master/budgea_api.py)|
|
290
|
-
|RUBY |[budgea.rb](https://github.com/budgetinsight/budgea-clients/blob/master/budgea.rb) |
|
291
|
-
|
292
|
-
To delegate to the Budgea API the management of the bank and provider credentials of your users, you have to
|
293
|
-
provide a button which redirects on the following page: `https://demo.biapi.pro/2.0/auth/share/`
|
294
|
-
|
295
|
-
You must first configure your client application. A client, in the OAuth 2 of the term, represents an application
|
296
|
-
accessing to the Budgea API. The parameters to supply to the URL are the following:
|
297
|
-
|
298
|
-
|Parameter |Description |
|
299
|
-
|---------------------|------------------------------------------------------------ |
|
300
|
-
|client_id |The client id of your application |
|
301
|
-
|redirect_uri |(optional) The adress where the user shoud be redirected after sharing his credentials. The adress must match the redirection URI set for the client |
|
302
|
-
|state |(optional) An arbitrary string sent back to you for control |
|
303
|
-
|types |The type of connectors (**banks** or **providers**) |
|
304
|
-
|connectors |(optional) Given a connector id, it will prefill the form |
|
305
|
-
|
306
|
-
You can use our libraries to generate this URL. It is also possible to get the HTML code of the button with
|
307
|
-
the libraries, the render is as below: ![Share your accounts button](https://demo.biapi.pro/2.0/auth/share/button_icon.png)
|
308
|
-
|
309
|
-
When the user confirms the share of his accounts with you, he is redirected to the callback URL you have defined. This one receives the following parameters:
|
310
|
-
|
311
|
-
|Parameter |Description |
|
312
|
-
|---------------------|-------------------------------------------------------------------------------------------------|
|
313
|
-
|code |A temporary token allowing you to get the **access_token** |
|
314
|
-
|state |The same string passed when redirecting to the webview |
|
315
|
-
|error |In case of error, the value will be **access_denied**, meaning the user has canceled the process |
|
316
|
-
|
317
|
-
Eventually, to get the **access_token** from the temporarily code which has been transmitted to you, you must call the API:
|
267
|
+
be obtained on the 1st step, by supplying a client_secret to /autinit and the step 6 is omitted. To get more
|
268
|
+
information, read the protocol. There are 3 steps to integrate Budgea in your application:
|
269
|
+
1. Provide a way for your users to share their credentials with you
|
270
|
+
2. Get the data scraped from Budgea
|
271
|
+
3. Be sure to follow the good practices before going into production
|
272
|
+
|
273
|
+
### Get credentials from users
|
274
|
+
You have 2 options here:
|
275
|
+
- Integrate the Budget Insight's Webview, a turnkey solution to get user's credentials
|
276
|
+
- Create your own form following the protocol (must have the *agent* status)
|
277
|
+
|
278
|
+
#### Webview
|
279
|
+
|
280
|
+
The webview allows your users to give their bank or provider credentials to the safety third-party Budgea API.
|
281
|
+
It is responsive, which means it displays correctly on a desktop or a mobile device.
|
282
|
+
The API meets the standard [OAuth 2](http://tools.ietf.org/html/rfc6749) and any client library that implements it will
|
283
|
+
be able to facilitate the integration to the Budgea API. We provide PHP, Python and Ruby modules to facilitate the
|
284
|
+
integration.
|
285
|
+
|
286
|
+
|Language | Library |
|
287
|
+
|-----------------|---------------------------------------------------------------------------------------- |
|
288
|
+
|PHP |[BudgeaAPI.php](https://github.com/budgetinsight/budgea-clients/blob/master/BudgeaAPI.php)|
|
289
|
+
|PYTHON |[budgea_api.py](https://github.com/budgetinsight/budgea-clients/blob/master/budgea_api.py)|
|
290
|
+
|RUBY |[budgea.rb](https://github.com/budgetinsight/budgea-clients/blob/master/budgea.rb) |
|
291
|
+
|
292
|
+
To delegate to the Budgea API the management of the bank and provider credentials of your users, you have to
|
293
|
+
provide a button which redirects on the following page: `https://demo.biapi.pro/2.0/auth/share/`
|
294
|
+
|
295
|
+
You must first configure your client application. A client, in the OAuth 2 of the term, represents an application
|
296
|
+
accessing to the Budgea API. The parameters to supply to the URL are the following:
|
297
|
+
|
298
|
+
|Parameter |Description |
|
299
|
+
|---------------------|------------------------------------------------------------ |
|
300
|
+
|client_id |The client id of your application |
|
301
|
+
|redirect_uri |(optional) The adress where the user shoud be redirected after sharing his credentials. The adress must match the redirection URI set for the client |
|
302
|
+
|state |(optional) An arbitrary string sent back to you for control |
|
303
|
+
|types |The type of connectors (**banks** or **providers**) |
|
304
|
+
|connectors |(optional) Given a connector id, it will prefill the form |
|
305
|
+
|
306
|
+
You can use our libraries to generate this URL. It is also possible to get the HTML code of the button with
|
307
|
+
the libraries, the render is as below: ![Share your accounts button](https://demo.biapi.pro/2.0/auth/share/button_icon.png)
|
308
|
+
|
309
|
+
When the user confirms the share of his accounts with you, he is redirected to the callback URL you have defined. This one receives the following parameters:
|
310
|
+
|
311
|
+
|Parameter |Description |
|
312
|
+
|---------------------|-------------------------------------------------------------------------------------------------|
|
313
|
+
|code |A temporary token allowing you to get the **access_token** |
|
314
|
+
|state |The same string passed when redirecting to the webview |
|
315
|
+
|error |In case of error, the value will be **access_denied**, meaning the user has canceled the process |
|
316
|
+
|
317
|
+
Eventually, to get the **access_token** from the temporarily code which has been transmitted to you, you must call the API:
|
318
318
|
|
319
319
|
```python
|
320
320
|
try:
|
321
321
|
if client.handleCallback(received_params):
|
322
|
-
# Keep the token associated with the user
|
323
|
-
# you can't get it twice
|
324
|
-
user.session['access_token'] = client.access_token
|
325
|
-
except client.StateInvalid:
|
326
|
-
# error if 'state' param provided to handleCallback doesn't match
|
327
|
-
except client.AuthFailed:
|
328
|
-
# There may be an error in the query (look for the message),
|
329
|
-
# Or return code is 'access_denied', the user has stopped the process
|
322
|
+
# Keep the token associated with the user
|
323
|
+
# you can't get it twice
|
324
|
+
user.session['access_token'] = client.access_token
|
325
|
+
except client.StateInvalid:
|
326
|
+
# error if 'state' param provided to handleCallback doesn't match
|
327
|
+
except client.AuthFailed:
|
328
|
+
# There may be an error in the query (look for the message),
|
329
|
+
# Or return code is 'access_denied', the user has stopped the process
|
330
330
|
```
|
331
|
-
|
331
|
+
|
332
332
|
You can now associate this **access_token** to your user, and use it in your next calls to the API with
|
333
333
|
the **Authorization** header. **IMPORTANT** It is important that your users are able to go back on the web,
|
334
334
|
authenticated on their Budgea API account, to add or remove accounts shared with you, and mostly to update their
|
335
335
|
credentials if needed. To do this, when your user is given an access_token, you have to provide him a link to access
|
336
336
|
the webview, similar to the first one, with an additional parameter: a temporarily token (30 minutes life-time).
|
337
|
-
|
338
|
-
It can be made with the library, by generating the URL with the following manner:
|
339
|
-
` print '<a href=\"%s\">Edit your accounts</a>' % client.get_settings_url()`
|
337
|
+
|
338
|
+
It can be made with the library, by generating the URL with the following manner:
|
339
|
+
` print '<a href=\"%s\">Edit your accounts</a>' % client.get_settings_url()`
|
340
340
|
|
341
341
|
After the modification, the user will go back on the callback URL. It will not be necessary to do anything (the access_token won't be changed).
|
342
|
-
|
343
|
-
#### Protocol
|
344
342
|
|
345
|
-
|
346
|
-
|
347
|
-
|
343
|
+
#### Protocol
|
344
|
+
|
345
|
+
This section describes the protocol used to set bank and provider accounts of a user, in case you don't want to use
|
346
|
+
the webview. The idea is to call the following services client-side (with AJAX in case of a web application),
|
347
|
+
to ensure the bank and providers credentials will not be sent to your servers. 1. /auth/init
|
348
348
|
|
349
|
-
```http
|
350
|
-
POST /auth/init
|
349
|
+
```http
|
350
|
+
POST /auth/init
|
351
351
|
```
|
352
352
|
|
353
353
|
```json
|
354
|
-
{
|
354
|
+
{
|
355
355
|
"auth_token": "fBqjMZbYddebUGlkR445JKPA6pCoRaGb",
|
356
356
|
"type": "temporary",
|
357
|
-
"expires_in": 1800
|
358
|
-
}
|
359
|
-
```
|
360
|
-
This service creates a temporarily token, to use in the \"Authorization\" header in next calls to the API
|
361
|
-
The returned token has a life-time of 30 minutes, and should be transfered to the API then (cf Permanent Token),
|
362
|
-
so that your server can get a permanent access_token. It is possible to generate a permanent token immediately, by
|
363
|
-
calling the service with the manage_token, or by supply parameters client_id and client_secret. 2. /banks or /providers
|
357
|
+
"expires_in": 1800
|
358
|
+
}
|
359
|
+
```
|
360
|
+
This service creates a temporarily token, to use in the \"Authorization\" header in next calls to the API
|
361
|
+
The returned token has a life-time of 30 minutes, and should be transfered to the API then (cf Permanent Token),
|
362
|
+
so that your server can get a permanent access_token. It is possible to generate a permanent token immediately, by
|
363
|
+
calling the service with the manage_token, or by supply parameters client_id and client_secret. 2. /banks or /providers
|
364
364
|
```http
|
365
|
-
GET /banks?expand=fields Authorization: Bearer <token>
|
366
|
-
```
|
365
|
+
GET /banks?expand=fields Authorization: Bearer <token>
|
366
|
+
```
|
367
367
|
```json
|
368
|
-
{
|
369
|
-
"banks"
|
370
|
-
|
368
|
+
{
|
369
|
+
"banks": [
|
370
|
+
{
|
371
|
+
"hidden": false,
|
372
|
+
"charged": true,
|
373
|
+
"name": "American Express",
|
374
|
+
"id": 30,
|
375
|
+
"fields": [
|
376
|
+
{
|
377
|
+
"values": [
|
378
|
+
{
|
379
|
+
"label": "Particuliers/Professionnels",
|
380
|
+
"value": "pp"
|
381
|
+
},
|
382
|
+
{
|
383
|
+
"value": "ent",
|
384
|
+
"label": "Entreprises"
|
385
|
+
}
|
386
|
+
],
|
387
|
+
"label": "Type de compte",
|
388
|
+
"regex": null,
|
389
|
+
"name": "website",
|
390
|
+
"type": "list"
|
391
|
+
},
|
392
|
+
{
|
393
|
+
"type": "password",
|
394
|
+
"label": "Code secret",
|
395
|
+
"name": "password",
|
396
|
+
"regex": "^[0-9]{6}$"
|
397
|
+
}
|
398
|
+
]
|
399
|
+
},
|
400
|
+
...
|
401
|
+
],
|
402
|
+
"total": 44
|
403
|
+
}
|
371
404
|
```
|
372
405
|
|
373
|
-
You get list of connectors, and all associated fields needed to build the form You can use that list to show your user
|
374
|
-
all available banks. 3. /users/me/connections You have to supply the id_bank (ID of the chosen bank) or
|
375
|
-
id_provider (ID of provider), and all requested fields as key/value parameters. You can get the following return codes:
|
406
|
+
You get list of connectors, and all associated fields needed to build the form You can use that list to show your user
|
407
|
+
all available banks. 3. /users/me/connections You have to supply the id_bank (ID of the chosen bank) or
|
408
|
+
id_provider (ID of provider), and all requested fields as key/value parameters. You can get the following return codes:
|
376
409
|
|
377
|
-
|Code |Description |
|
378
|
-
|---------------|------------------------------------------------------------ |
|
379
|
-
|200 |The connection has succeed and has been created |
|
380
|
-
|202 |It is necessary to provide complementary information. This occurs on the first connection on some kind of Boursorama accounts for example, where a SMS is sent to the customer. It is necessary to ask the user to fill fields requested in the fields, and do a POST again on /users/me/connections/ID, with the connection ID in id_connection. |
|
381
|
-
|400 |Unable to connect to the website, the field error in the JSON can be **websiteUnavailable** or **wrongpass** |
|
410
|
+
|Code |Description |
|
411
|
+
|---------------|------------------------------------------------------------ |
|
412
|
+
|200 |The connection has succeed and has been created |
|
413
|
+
|202 |It is necessary to provide complementary information. This occurs on the first connection on some kind of Boursorama accounts for example, where a SMS is sent to the customer. It is necessary to ask the user to fill fields requested in the fields, and do a POST again on /users/me/connections/ID, with the connection ID in id_connection. |
|
414
|
+
|400 |Unable to connect to the website, the field error in the JSON can be **websiteUnavailable** or **wrongpass** |
|
382
415
|
|403 |Invalid token |
|
383
|
-
|
384
|
-
4. Permanent token If the user validates the share of accounts with you, it is necessary to transform the temporarily
|
385
|
-
code to a permanent access_token. To do that, you have to supply it to your server, which should do a POST
|
386
|
-
request on `/auth/token/access` with the following parameters:
|
387
416
|
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|client_id |The ID of your client application |
|
392
|
-
|client_secret |The secret of your client application |
|
417
|
+
4. Permanent token If the user validates the share of accounts with you, it is necessary to transform the temporarily
|
418
|
+
code to a permanent access_token. To do that, you have to supply it to your server, which should do a POST
|
419
|
+
request on `/auth/token/access` with the following parameters:
|
393
420
|
|
394
|
-
|
395
|
-
|
421
|
+
|Parameter |Description |
|
422
|
+
|---------------------|----------------------------------------------------------------|
|
423
|
+
|code |The temporarily token which will let you get the access_token |
|
424
|
+
|client_id |The ID of your client application |
|
425
|
+
|client_secret |The secret of your client application |
|
396
426
|
|
397
|
-
|
427
|
+
```http
|
428
|
+
POST /auth/token/access
|
429
|
+
```
|
430
|
+
```json
|
431
|
+
{
|
432
|
+
"client_id": 17473055,
|
433
|
+
"client_secret": "54tHJHjvodbANVzaRtcLzlHGXQiOgw80",
|
434
|
+
"code": "fBqjMZbYddebUGlkR445JKPA6pCoRaGb"
|
435
|
+
}
|
436
|
+
```
|
437
|
+
|
438
|
+
```http
|
439
|
+
HTTP/1.1 200 OK
|
440
|
+
```
|
441
|
+
```json
|
442
|
+
{
|
443
|
+
"access_token": "7wBPuFfb1Hod82f1+KNa0AmrkIuQ3h1G",
|
444
|
+
"token_type":"Bearer"
|
445
|
+
}
|
446
|
+
```
|
447
|
+
|
448
|
+
### Update accounts
|
398
449
|
|
399
450
|
Another important call is when a user wants to add/remove connections to banks or providers, or to change the password
|
400
|
-
on one of them, it is advised to give him a temporarily code from the permanent access_token, with the following call
|
401
|
-
(using the access_token as bearer):
|
451
|
+
on one of them, it is advised to give him a temporarily code from the permanent access_token, with the following call
|
452
|
+
(using the access_token as bearer):
|
402
453
|
|
403
|
-
```http POST /auth/token/code Authorization: Bearer <token> ```
|
454
|
+
```http POST /auth/token/code Authorization: Bearer <token> ```
|
404
455
|
|
405
456
|
```json
|
406
|
-
{
|
407
|
-
|
457
|
+
{
|
458
|
+
"code": "/JiDppWgbmc+5ztHIUJtHl0ynYfw682Z",
|
459
|
+
"type": "temporary",
|
460
|
+
"expires_in": 1800
|
461
|
+
}
|
462
|
+
```
|
408
463
|
|
409
|
-
Its life-time is 30 minutes, and let the browser to list connections and accounts,
|
410
|
-
via `GET /users/me/connections?expand=accounts` for example.
|
464
|
+
Its life-time is 30 minutes, and let the browser to list connections and accounts,
|
465
|
+
via `GET /users/me/connections?expand=accounts` for example.
|
411
466
|
|
412
|
-
To update the password of a connection, you can do a POST on the *connection* resource, with the field *password*
|
413
|
-
in the data. The new credentials are checked to make sure they are valid, and the return codes are the same as when
|
414
|
-
adding a connection. ## Getting the data You have created your users and their connections, now it's time to get the
|
467
|
+
To update the password of a connection, you can do a POST on the *connection* resource, with the field *password*
|
468
|
+
in the data. The new credentials are checked to make sure they are valid, and the return codes are the same as when
|
469
|
+
adding a connection. ## Getting the data You have created your users and their connections, now it's time to get the
|
415
470
|
data. There are 2 ways to retrieve it, the 2 can be complementary: - make regular calls to the API - use the webhooks
|
416
|
-
(recommended)
|
417
|
-
|
471
|
+
(recommended)
|
472
|
+
|
418
473
|
### Manual Synchronization
|
419
|
-
It is possible to do a manual synchronization of a user. We recommend to use this method in case the user wants fresh data after logging in.
|
420
|
-
To trigger the synchronization, call the API as below: `PUT /users/ID/connections` The following call is blocking until the synchronization is terminated.
|
421
|
-
Even if it is not recommended, it's possible to fetch synchronously new data. To do that, you can use the *expand* parameter:
|
422
|
-
` /users/ID/connections?expand=accounts[transactions,investments[type]],subscriptions`
|
474
|
+
It is possible to do a manual synchronization of a user. We recommend to use this method in case the user wants fresh data after logging in.
|
475
|
+
To trigger the synchronization, call the API as below: `PUT /users/ID/connections` The following call is blocking until the synchronization is terminated.
|
476
|
+
Even if it is not recommended, it's possible to fetch synchronously new data. To do that, you can use the *expand* parameter:
|
477
|
+
` /users/ID/connections?expand=accounts[transactions,investments[type]],subscriptions`
|
423
478
|
|
424
|
-
```json
|
425
|
-
{
|
479
|
+
```json
|
480
|
+
{
|
481
|
+
"connections": [
|
482
|
+
{
|
483
|
+
"accounts": [
|
484
|
+
{
|
485
|
+
"balance": 7481.01,
|
486
|
+
"currency": {
|
487
|
+
"symbol": "€",
|
488
|
+
"id": "EUR",
|
489
|
+
"prefix": false
|
490
|
+
},
|
491
|
+
"deleted": null,
|
492
|
+
"display": true,
|
493
|
+
"formatted_balance": "7 481,01 €",
|
494
|
+
"iban": "FR76131048379405300290000016",
|
495
|
+
"id": 17,
|
496
|
+
"id_connection": 7,
|
497
|
+
"investments": [
|
498
|
+
{
|
499
|
+
"code": "FR0010330902",
|
500
|
+
"description": "",
|
501
|
+
"diff": -67.86,
|
502
|
+
"id": 55,
|
503
|
+
"id_account": 19,
|
504
|
+
"id_type": 1,
|
505
|
+
"label": "Agressor PEA",
|
506
|
+
"portfolio_share": 0.48,
|
507
|
+
"prev_diff": 2019.57,
|
508
|
+
"quantity": 7.338,
|
509
|
+
"type": {
|
510
|
+
"color": "AABBCC",
|
511
|
+
"id": 1,
|
512
|
+
"name": "Fonds action"
|
513
|
+
},
|
514
|
+
"unitprice": 488.98,
|
515
|
+
"unitvalue": 479.73,
|
516
|
+
"valuation": 3520.28
|
517
|
+
}
|
518
|
+
],
|
519
|
+
"last_update": "2015-07-04 15:17:30",
|
520
|
+
"name": "Compte chèque",
|
521
|
+
"number": "3002900000",
|
522
|
+
"transactions": [
|
523
|
+
{
|
524
|
+
"active": true,
|
525
|
+
"application_date": "2015-06-17",
|
526
|
+
"coming": false,
|
527
|
+
"comment": null,
|
528
|
+
"commission": null,
|
529
|
+
"country": null,
|
530
|
+
"date": "2015-06-18",
|
531
|
+
"date_scraped": "2015-07-04 15:17:30",
|
532
|
+
"deleted": null,
|
533
|
+
"documents_count": 0,
|
534
|
+
"formatted_value": "-16,22 €",
|
535
|
+
"id": 309,
|
536
|
+
"id_account": 17,
|
537
|
+
"id_category": 9998,
|
538
|
+
"id_cluster": null,
|
539
|
+
"last_update": "2015-07-04 15:17:30",
|
540
|
+
"new": true,
|
541
|
+
"original_currency": null,
|
542
|
+
"original_value": null,
|
543
|
+
"original_wording": "FACTURE CB HALL'S BEER",
|
544
|
+
"rdate": "2015-06-17",
|
545
|
+
"simplified_wording": "HALL'S BEER",
|
546
|
+
"state": "parsed",
|
547
|
+
"stemmed_wording": "HALL'S BEER",
|
548
|
+
"type": "card",
|
549
|
+
"value": -16.22,
|
550
|
+
"wording": "HALL'S BEER"
|
551
|
+
}
|
552
|
+
],
|
553
|
+
"type": "checking"
|
554
|
+
}
|
555
|
+
],
|
556
|
+
"error": null,
|
557
|
+
"expire": null,
|
558
|
+
"id": 7,
|
559
|
+
"id_user": 7,
|
560
|
+
"id_bank": 41,
|
561
|
+
"last_update": "2015-07-04 15:17:31"
|
562
|
+
}
|
563
|
+
],
|
564
|
+
"total": 1
|
565
|
+
}
|
426
566
|
```
|
427
567
|
|
428
568
|
### Background synchronizations & Webhooks
|
429
569
|
|
430
|
-
Webhooks are callbacks sent to your server, when an event is triggered during a synchronization.
|
431
|
-
Synchronizations are automatic, the frequency can be set using the configuration key `autosync.frequency`.
|
432
|
-
Using webhooks allows you to get the most up-to-date data of your users, after each synchronization.
|
433
|
-
The automatic synchronization makes it possible to recover new bank entries, or new invoices, at a given frequency.
|
434
|
-
You have the possibility to add webhooks on several events, and choose to receive each one on a distinct URL.
|
435
|
-
To see the list of available webhooks you can call the endpoint hereunder:
|
570
|
+
Webhooks are callbacks sent to your server, when an event is triggered during a synchronization.
|
571
|
+
Synchronizations are automatic, the frequency can be set using the configuration key `autosync.frequency`.
|
572
|
+
Using webhooks allows you to get the most up-to-date data of your users, after each synchronization.
|
573
|
+
The automatic synchronization makes it possible to recover new bank entries, or new invoices, at a given frequency.
|
574
|
+
You have the possibility to add webhooks on several events, and choose to receive each one on a distinct URL.
|
575
|
+
To see the list of available webhooks you can call the endpoint hereunder:
|
436
576
|
|
437
|
-
```
|
577
|
+
```
|
438
578
|
curl -X GET \
|
439
579
|
https://demo.biapi.pro/2.0/webhooks_events \
|
440
|
-
-H 'Authorization: Bearer <token>'
|
580
|
+
-H 'Authorization: Bearer <token>'
|
441
581
|
```
|
442
582
|
|
443
|
-
The background synchronizations for each user are independent, and their plannings are spread over the day so that they do not overload any website. Once the synchronization of a user is over, a POST request is sent on the callback URL you have defined, including all webhook data. A typical json sent to your server is as below:
|
583
|
+
The background synchronizations for each user are independent, and their plannings are spread over the day so that they do not overload any website. Once the synchronization of a user is over, a POST request is sent on the callback URL you have defined, including all webhook data. A typical json sent to your server is as below:
|
444
584
|
|
445
585
|
```http
|
446
|
-
POST /callback HTTP/1.1 Host: example.org
|
447
|
-
Content-Length: 959 Accept-Encoding: gzip, deflate, compress
|
448
|
-
Accept: */* User-Agent: Budgea API/2.0
|
449
|
-
Content-Type: application/json; charset=utf-8
|
450
|
-
Authorization: Bearer sl/wuqgD2eOo+4Zf9FjvAz3YJgU+JKsJ
|
451
|
-
|
586
|
+
POST /callback HTTP/1.1 Host: example.org
|
587
|
+
Content-Length: 959 Accept-Encoding: gzip, deflate, compress
|
588
|
+
Accept: */* User-Agent: Budgea API/2.0
|
589
|
+
Content-Type: application/json; charset=utf-8
|
590
|
+
Authorization: Bearer sl/wuqgD2eOo+4Zf9FjvAz3YJgU+JKsJ
|
591
|
+
```
|
592
|
+
```json
|
593
|
+
{
|
594
|
+
"connections": [
|
595
|
+
{
|
596
|
+
"accounts": [
|
597
|
+
{
|
598
|
+
"balance": 7481.01,
|
599
|
+
"currency": {
|
600
|
+
"symbol": "€",
|
601
|
+
"id": "EUR",
|
602
|
+
"prefix": false
|
603
|
+
},
|
604
|
+
"deleted": null,
|
605
|
+
"display": true,
|
606
|
+
"formatted_balance": "7 481,01 €",
|
607
|
+
"iban": "FR76131048379405300290000016",
|
608
|
+
"id": 17,
|
609
|
+
"id_connection": 7,
|
610
|
+
"investments": [
|
611
|
+
{
|
612
|
+
"code": "FR0010330902",
|
613
|
+
"description": "",
|
614
|
+
"diff": -67.86,
|
615
|
+
"id": 55,
|
616
|
+
"id_account": 19,
|
617
|
+
"id_type": 1,
|
618
|
+
"label": "Agressor PEA",
|
619
|
+
"portfolio_share": 0.48,
|
620
|
+
"prev_diff": 2019.57,
|
621
|
+
"quantity": 7.338,
|
622
|
+
"type": {
|
623
|
+
"color": "AABBCC",
|
624
|
+
"id": 1,
|
625
|
+
"name": "Fonds action"
|
626
|
+
},
|
627
|
+
"unitprice": 488.98,
|
628
|
+
"unitvalue": 479.73,
|
629
|
+
"valuation": 3520.28
|
630
|
+
}
|
631
|
+
],
|
632
|
+
"last_update": "2015-07-04 15:17:30",
|
633
|
+
"name": "Compte chèque",
|
634
|
+
"number": "3002900000",
|
635
|
+
"transactions": [
|
636
|
+
{
|
637
|
+
"active": true,
|
638
|
+
"application_date": "2015-06-17",
|
639
|
+
"coming": false,
|
640
|
+
"comment": null,
|
641
|
+
"commission": null,
|
642
|
+
"country": null,
|
643
|
+
"date": "2015-06-18",
|
644
|
+
"date_scraped": "2015-07-04 15:17:30",
|
645
|
+
"deleted": null,
|
646
|
+
"documents_count": 0,
|
647
|
+
"formatted_value": "-16,22 €",
|
648
|
+
"id": 309,
|
649
|
+
"id_account": 17,
|
650
|
+
"id_category": 9998,
|
651
|
+
"id_cluster": null,
|
652
|
+
"last_update": "2015-07-04 15:17:30",
|
653
|
+
"new": true,
|
654
|
+
"original_currency": null,
|
655
|
+
"original_value": null,
|
656
|
+
"original_wording": "FACTURE CB HALL'S BEER",
|
657
|
+
"rdate": "2015-06-17",
|
658
|
+
"simplified_wording": "HALL'S BEER",
|
659
|
+
"state": "parsed",
|
660
|
+
"stemmed_wording": "HALL'S BEER",
|
661
|
+
"type": "card",
|
662
|
+
"value": -16.22,
|
663
|
+
"wording": "HALL'S BEER"
|
664
|
+
}
|
665
|
+
],
|
666
|
+
"type": "checking"
|
667
|
+
}
|
668
|
+
],
|
669
|
+
"bank": {
|
670
|
+
"id_weboob": "ing",
|
671
|
+
"charged": true,
|
672
|
+
"name": "ING Direct",
|
673
|
+
"id": 7,
|
674
|
+
"hidden": false
|
675
|
+
},
|
676
|
+
"error": null,
|
677
|
+
"expire": null,
|
678
|
+
"id": 7,
|
679
|
+
"id_user": 7,
|
680
|
+
"id_bank": 41,
|
681
|
+
"last_update": "2015-07-04 15:17:31"
|
682
|
+
}
|
683
|
+
],
|
684
|
+
"total": 1,
|
685
|
+
"user": {
|
686
|
+
"signin": "2015-07-04 15:17:29",
|
687
|
+
"id": 7,
|
688
|
+
"platform": "sharedAccess"
|
689
|
+
}
|
690
|
+
}
|
452
691
|
```
|
453
692
|
|
454
|
-
The authentication on the callback is made with the access_token of the user (which is a shared secret between your server and the Budgea API). When you are in production, it is needed to define a HTTPS URL using a valid certificate, delivered by a recognized authority. If this is not the case, you can contact us to add your CA (Certificate Authority) to our PKI (Public Key Infrastructure). Important: it is necessary to send back a HTTP 200 code, without what we consider that data is not correctly taken into account on your system, and it will be sent again at the next user synchronization. ## Guidelines for production Now you should have integrated the API inside your application. Make sure your Webhooks URLs are in HTTPS, if so you can enable the production state of the API. To make things great, here are some good practices, please check you have respected them: - You have provided to your users a way to configure their accounts - You have provided to your users a way to change their account passwords - You consider the **error** field of Connections, to alert the user in case the state is **wrongpass** - You map IDs of Accounts, Subscriptions, Transactions and Documents in your application, to be sure to correctly match them - When the deleted field is set on a bank transaction, you delete it in your database - You don't loop on all users to launch synchronizations, this might saturate the service If you have questions about above points, please contact us. Otherwise, you can put into production!
|
693
|
+
The authentication on the callback is made with the access_token of the user (which is a shared secret between your server and the Budgea API). When you are in production, it is needed to define a HTTPS URL using a valid certificate, delivered by a recognized authority. If this is not the case, you can contact us to add your CA (Certificate Authority) to our PKI (Public Key Infrastructure). Important: it is necessary to send back a HTTP 200 code, without what we consider that data is not correctly taken into account on your system, and it will be sent again at the next user synchronization. ## Guidelines for production Now you should have integrated the API inside your application. Make sure your Webhooks URLs are in HTTPS, if so you can enable the production state of the API. To make things great, here are some good practices, please check you have respected them: - You have provided to your users a way to configure their accounts - You have provided to your users a way to change their account passwords - You consider the **error** field of Connections, to alert the user in case the state is **wrongpass** - You map IDs of Accounts, Subscriptions, Transactions and Documents in your application, to be sure to correctly match them - When the deleted field is set on a bank transaction, you delete it in your database - You don't loop on all users to launch synchronizations, this might saturate the service If you have questions about above points, please contact us. Otherwise, you can put into production!
|
455
694
|
|
456
695
|
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
457
696
|
|
@@ -505,8 +744,8 @@ require 'budgea_client'
|
|
505
744
|
|
506
745
|
api_instance = BudgeaClient::AdministrationApi.new
|
507
746
|
|
508
|
-
opts = {
|
509
|
-
expand: "expand_example" # String |
|
747
|
+
opts = {
|
748
|
+
expand: "expand_example" # String |
|
510
749
|
}
|
511
750
|
|
512
751
|
begin
|