Skip to content

Commit 89f69ba

Browse files
committed
2 parents 7a722f6 + e24984f commit 89f69ba

File tree

101 files changed

+578
-229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+578
-229
lines changed

README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
<p align="center">
2-
<img src="docs/static/img/nordigen-api-client-logo.png" width="30%">
2+
<img src="https://raw.githubusercontent.com/RobinTTY/NordigenApiClient/main/docs/static/img/nordigen-api-client-logo.png" width="30%">
33
</p>
44

55
# NordigenApiClient
66

7-
This library provides a .NET client for the [GoCardless Bank Account Data API](https://gocardless.com/bank-account-data/) (formerly Nordigen API). The following API endpoints are supported:
7+
This library provides a .NET client for
8+
the [GoCardless Bank Account Data API](https://gocardless.com/bank-account-data/) (formerly Nordigen API). The following
9+
API endpoints are supported:
810

911
- Token
1012
- Institutions
1113
- Agreements
1214
- Requisitions
1315
- Accounts
1416

15-
You can get started with the Quickstart Guide below or take a look at the [full documentation](https://robintty.github.io/NordigenApiClient/). You can find the nuget package [here](https://www.nuget.org/packages/RobinTTY.NordigenApiClient).
17+
You can get started with the Quickstart Guide below or take a look at
18+
the [full documentation](https://robintty.github.io/NordigenApiClient/). You can find the nuget
19+
package [here](https://www.nuget.org/packages/RobinTTY.NordigenApiClient).
1620

1721
## Quickstart Guide
1822

@@ -61,11 +65,13 @@ You can get started with the Quickstart Guide below or take a look at the [full
6165
Console.WriteLine($"Requisition couldn't be created: {requisitionResponse.Error.Summary}");
6266
```
6367

64-
5. You will now need to accept the end user agreement by following the authentication link you got in the last step. The authentication flow will roughly look like this:
68+
5. You will now need to accept the end user agreement by following the authentication link you got in the last step. The
69+
authentication flow will roughly look like this:
6570

6671
![authentication-flow](docs/static/img/authentication_flow.png)
6772

68-
6. Now that you have accepted the agreement we once again need to retrieve the requisition we created in step 4. This time the response will include the accounts you are now able to access.
73+
6. Now that you have accepted the agreement we once again need to retrieve the requisition we created in step 4. This
74+
time the response will include the accounts you are now able to access.
6975

7076
```cs
7177
var requisitionId = "your-requisition-id";
@@ -79,7 +85,8 @@ You can get started with the Quickstart Guide below or take a look at the [full
7985
Console.WriteLine($"Accounts couldn't be retrieved: {accountsResponse.Error.Summary}");
8086
```
8187

82-
7. Now you can retrieve details about your bank account and the balances/transactions using the account ID(s) we just acquired:
88+
7. Now you can retrieve details about your bank account and the balances/transactions using the account ID(s) we just
89+
acquired:
8390

8491
```cs
8592
var accountId = "your-account-id";
@@ -110,4 +117,6 @@ You can get started with the Quickstart Guide below or take a look at the [full
110117
});
111118
```
112119

113-
That's it! You are now able to retrieve the account details, balances and transactions of your bank account. If you wanna learn more about this library please refer to the [full documentation](https://robintty.github.io/NordigenApiClient/).
120+
That's it! You are now able to retrieve the account details, balances and transactions of your bank account. If you
121+
wanna learn more about this library please refer to
122+
the [full documentation](https://robintty.github.io/NordigenApiClient/).
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: ApiRateLimits
3+
---
4+
5+
The `ApiRateLimits` class represents the rate limits of the GoCardless API.
6+
7+
## Properties
8+
9+
### `RequestLimit` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)
10+
11+
Indicates the maximum number of allowed requests within the defined time window. Usually populated in every response.
12+
13+
### `RemainingRequests` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)
14+
15+
Indicates the number of remaining requests you can make in the current time window. Usually populated in every response.
16+
17+
### `RemainingSecondsInTimeWindow` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)
18+
19+
Indicates the time remaining in the current time window (in seconds). Usually populated in every response.
20+
21+
### `RequestLimitAccountsEndpoint` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)
22+
23+
Indicates the maximum number of allowed requests to the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint) within the defined time window. Only populated in responses from the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint).
24+
25+
### `RemainingRequestsAccountsEndpoint` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)
26+
27+
Indicates the number of remaining requests to the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint) you can make in the current time window. Only populated in responses from the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint).
28+
29+
### `RemainingSecondsInTimeWindowAccountsEndpoint` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)
30+
31+
Indicates the time remaining in the current time window (in seconds) for requests to the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint). Only populated in responses from the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint).
32+
33+
## Constructor
34+
35+
```csharp
36+
public ApiRateLimits(int requestLimit, int remainingRequests, int remainingTimeInTimeWindow,
37+
int maxAccountRequests, int remainingAccountRequests, int remainingTimeInAccountTimeWindow)
38+
```
39+
40+
### Parameters
41+
42+
#### `requestLimit` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)?
43+
44+
Indicates the maximum number of allowed requests within the defined time window. Usually populated in every response.
45+
46+
#### `remainingRequests` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)?
47+
48+
Indicates the number of remaining requests you can make in the current time window. Usually populated in every response.
49+
50+
#### `remainingSecondsInTimeWindow` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)?
51+
52+
Indicates the time remaining in the current time window (in seconds). Usually populated in every response.
53+
54+
#### `requestLimitAccountsEndpoint` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)?
55+
56+
Indicates the maximum number of allowed requests to the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint) within the defined time window. Only populated in responses from the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint).
57+
58+
#### `remainingRequestsAccountsEndpoint` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)?
59+
60+
Indicates the number of remaining requests to the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint) you can make in the current time window. Only populated in responses from the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint).
61+
62+
#### `remainingSecondsInTimeWindowAccountsEndpoint` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)?
63+
64+
Indicates the time remaining in the current time window (in seconds) for requests to the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint). Only populated in responses from the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint).

docs/docs/api-reference/responses/nordigen-api-response.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,15 @@ The result returned by the API. Null if the the HTTP response was not successful
2222

2323
The error returned by the API. Null if the HTTP response was successful.
2424

25+
### `RateLimits` - [ApiRateLimits](/docs/api-reference/responses/api-rate-limits)
26+
27+
The rate limits of the GoCardless API.
28+
2529
## Constructor
2630

2731
```csharp
28-
public NordigenApiResponse(HttpStatusCode statusCode, bool isSuccess, TResult? result, TError? apiError)
32+
public NordigenApiResponse(HttpStatusCode statusCode, bool isSuccess,
33+
TResult? result, TError? apiError, ApiRateLimits rateLimits)
2934
```
3035

3136
### Parameters
@@ -46,6 +51,10 @@ The result returned by the API. Null if the the HTTP response was not successful
4651

4752
The error returned by the API. Null if the HTTP response was successful.
4853

54+
#### `rateLimits` - [ApiRateLimits](/docs/api-reference/responses/api-rate-limits)
55+
56+
The rate limits of the GoCardless API.
57+
4958
## Handling the `NordigenApiResponse` type
5059

5160
To learn more about how to best work with the `NordigenApiResponse` type see the [Handling API responses](/docs/handling-api-responses) guide.

docs/docs/handling-rate-limits.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: Handling Rate Limits
3+
---
4+
5+
The GoCardless API has [rate limits](https://bankaccountdata.zendesk.com/hc/en-gb/articles/11529637772188-Bank-Account-Data-API-Rate-Limits) depending on the endpoint you are using. With most endpoints you shouldn't run into problems since these limits are usually high enough for most uses.
6+
7+
The [Accounts endpoint](/docs/api-reference/endpoints/accounts-endpoint) has very tight limitations though. It currently has a limit of 10 requests a day per access scope. That means 10 requests to each of the [details](/docs/api-reference/endpoints/accounts-endpoint#getaccountdetails), [balances](/docs/api-reference/endpoints/accounts-endpoint#getbalances) and [transactions](/docs/api-reference/endpoints/accounts-endpoint#gettransactions) endpoints. In the future this limit will be lowered to 4 per day (no date on this as of now).
8+
9+
Unsuccessful requests to the API will count towards the general rate limits but not the more stringent limits of the [Accounts endpoint](/docs/api-reference/endpoints/accounts-endpoint). Only successful requests will count towards those.
10+
11+
## Checking API rate limits
12+
13+
You can check the rate limits as well as remaining requests with each request you make to the API. The property [`NordigenApiResponse.RateLimits`](/docs/api-reference/responses/nordigen-api-response#ratelimits---apiratelimits) will hold the returned information about the current API limits.
14+
15+
You can check the limits as follows:
16+
17+
```csharp
18+
// Execute the request you want to make:
19+
var bankAccountDetailsResponse = await client.AccountsEndpoint.GetAccountDetails(accountId);
20+
21+
Console.WriteLine(bankAccountDetailsResponse.RateLimits.RequestLimit);
22+
Console.WriteLine(bankAccountDetailsResponse.RateLimits.RemainingRequests);
23+
Console.WriteLine(bankAccountDetailsResponse.RateLimits.RemainingSecondsInTimeWindow);
24+
Console.WriteLine(bankAccountDetailsResponse.RateLimits.RequestLimitAccountsEndpoint);
25+
Console.WriteLine(bankAccountDetailsResponse.RateLimits.RemainingRequestsAccountsEndpoint);
26+
Console.WriteLine(bankAccountDetailsResponse.RateLimits.RemainingSecondsInTimeWindowAccountsEndpoint);
27+
```
28+
29+
It's important to handle these limits so your applications user experience isn't degraded. Refreshing data from bank accounts should be handled consciously, so you don't use up all your requests in a short time frame and aren't able to update for the rest of the day.
30+
31+
If you are a company with a contract with GoCardless you can probably get in contact with their team about increasing these limits.

docs/release-notes/v10_0_0.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public async Task<NordigenApiResponse<List<Institution>, BasicResponse>> GetInst
3939

4040
The `TokenPairUpdated` event is now raised whenever the `JsonWebTokenPair` property is successfully updated. Not only when it was automatically updated but also when done so by the user.
4141

42-
**Full Changelog**: [v9.0.0...v10.0.0](https://github.com/RobinTTY/NordigenApiClient/compare/v9.0.0...v10.0.0)
43-
4442
## Other improvements
4543

4644
A full documentation of the library is now available at: [https://robintty.github.io/NordigenApiClient/](https://robintty.github.io/NordigenApiClient/)
45+
46+
**Full Changelog**: [v9.0.0...v10.0.0](https://github.com/RobinTTY/NordigenApiClient/compare/v9.0.0...v10.0.0)

docs/release-notes/v10_1_0.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
slug: v10.1.0
3+
title: v10.1.0
4+
date: 2024-08-19T00:00
5+
---
6+
7+
Added the ability to check newly introduced rate limits in the GoCardless API.
8+
9+
Please refer to the [documentation](/docs/handling-rate-limits) for more information. You can also see the [announcement from GoCardless](https://bankaccountdata.zendesk.com/hc/en-gb/articles/11529584398236-Bank-API-Rate-Limits-and-Rate-Limit-Headers).
10+
11+
**Full Changelog**: [v10.0.0...v10.1.0](https://github.com/RobinTTY/NordigenApiClient/compare/v10.0.0...v10.1.0)

docs/sidebars.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const sidebars: SidebarsConfig = {
66
"quickstart-guide",
77
"handling-api-responses",
88
"handling-authentication-tokens",
9+
"handling-rate-limits",
910
"using-a-different-base-address",
1011
"usage-with-older-dotnet-versions",
1112
"testing",
@@ -38,6 +39,7 @@ const sidebars: SidebarsConfig = {
3839
"api-reference/responses/address",
3940
"api-reference/responses/agreement",
4041
"api-reference/responses/amount-currency-pair",
42+
"api-reference/responses/api-rate-limits",
4143
"api-reference/responses/balance",
4244
"api-reference/responses/balance-type",
4345
"api-reference/responses/bank-account",

src/RobinTTY.NordigenApiClient.ExampleApplication/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@
7272
Console.WriteLine($"Remittance: {transaction.RemittanceInformationUnstructured}");
7373
Console.WriteLine($"Booking date:{transaction.ValueDate}");
7474
Console.WriteLine($"Amount: {transactionAmount.Amount} {transactionAmount.Currency}");
75-
});
75+
});

src/RobinTTY.NordigenApiClient.Tests/.idea/.idea.RobinTTY.NordigenApiClient.dir/.idea/.gitignore

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/RobinTTY.NordigenApiClient.Tests/.idea/.idea.RobinTTY.NordigenApiClient.dir/.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)