Skip to content

Commit 078e7d5

Browse files
committed
add link to scopes documentation
1 parent 3c391b5 commit 078e7d5

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

README.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
**FortnoxApiClient** is a third party [Fortnox API](https://apps.fortnox.se/apidocs) client for NodeJS. It is a wrapper around an API client that has been [automatically generated](https://www.npmjs.com/package/swagger-typescript-api) using the [OpenAPI schema](https://apps.fortnox.se/api/apidocs/swagger-v1) provided by Fortnox.
44

5-
65
## Installation
76

87
Add to project's package.json:
@@ -67,21 +66,20 @@ const tokens = await FortnoxApiClient.getTokensByAuthorizationCode(
6766
// tokens.accessToken = 1hour token to use Fortnox API
6867
// tokens.refreshToken = 45day long lived token to refresh access token when necessary
6968
```
69+
7070
## Setup client with options
7171

7272
```javascript
73-
const fortnox = new FortnoxApiClient(
74-
{
75-
clientId: 'your client id',
76-
clientSecret: 'your client secret',
77-
78-
// To use endpoints you need to provide either accessToken or refreshToken to the client
79-
// If refreshToken is provided, the accessToken will be acquired on first request and refreshToken will also refresh
80-
// To acquire these tokens see above information about authentication/authorization
81-
accessToken: 'token for Fortnox API',
82-
refreshToken: 'token for Fortnox API'
83-
}
84-
);
73+
const fortnox = new FortnoxApiClient({
74+
clientId: 'your client id',
75+
clientSecret: 'your client secret',
76+
77+
// To use endpoints you need to provide either accessToken or refreshToken to the client
78+
// If refreshToken is provided, the accessToken will be acquired on first request and refreshToken will also refresh
79+
// To acquire these tokens see above information about authentication/authorization
80+
accessToken: 'token for Fortnox API',
81+
refreshToken: 'token for Fortnox API'
82+
});
8583
```
8684

8785
Example usage after initialization:
@@ -99,3 +97,4 @@ Available methods can be found in the [API documentation](https://apps.fortnox.s
9997
- Fortnox: https://www.fortnox.se/
10098
- Fortnox API Guide: https://apps.fortnox.se/apidocs
10199
- Fortnox Authorization Guide: https://www.fortnox.se/developer/authorization
100+
- Fortnox API scopes: https://www.fortnox.se/developer/guides-and-good-to-know/scopes

0 commit comments

Comments
 (0)