Skip to content

Commit

Permalink
Updated README with vatCodes and additional info for authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Schillemans committed Sep 17, 2021
1 parent 11fdc03 commit 240d329
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,26 @@ Make the connection with your provided CLIENTID and CLIENTSECRET.
api = ExactOnlineAPI(CLIENTID, CLIENTSECRET)
```

Exact Online authentication is build on OAuth2. A basic script to obtain your first tokens can be found below. After you've obtained your tokens, the refresh tokens are automatically used to renew the token if needed. No manual action is required after that.

```python
from exactonline.api import ExactOnlineAPI

REDIRECT_URI = 'https://any-url-will-do.com/callback/'

api = ExactOnlineAPI(CLIENTID, CLIENTSECRET)

authUrl = api.authHandler.getAuthURL(REDIRECT_URI)
print(authUrl)

response = input('paste response: ')
token = api.authHandler.retrieveToken(response, redirectUri=REDIRECT_URI)
```

When using the script above, any REDIRECT_URI will do. Simply copy and paste the response URI so the handler can obtain the right tokens.

!! The Redirect URI has to be registered in your Exact App Center.

## Available functionalities

| Object | Endpoint | Actions |
Expand All @@ -40,6 +60,7 @@ api = ExactOnlineAPI(CLIENTID, CLIENTSECRET)
| GLAccounts | glAccounts | List, Get, Filter, Create, Update, Delete |
| Accounts | accounts | List, Get, Filter, Create, Update, Delete |
| Contacts | contacts | List, Get, Filter, Create, Update, Delete |
| VATCodes | vatCodes | List, Get, Filter, Create, Update, Delete |

## Basic setup

Expand Down

0 comments on commit 240d329

Please sign in to comment.