Skip to content

Gem for fetching Fortnox access token with authorization code

Notifications You must be signed in to change notification settings

standout/fortnox_access_token

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple gem for fetching Fortnox integration access token using authorization code

Fortnox AIP documentation

For the gem to work it requires three parts:

  • Fortnox base uri: Forntox base uri can be set as an environment variable with the key 'FORTNOX_BASE_URL' or will use the default 'https://api.fortnox.se/3/'.
  • Authorization code: The code a Fortnox user will receive when adding an integration. See Fortnox AIP documentation. Authorization code is sent in as the first argument to the 'retrieve!' method.
  • Client secret: Uniqe identifier for your integration you will receive in the registration email when you register as a developer at Fortnox. Client secret can be set as an environment variable with the key 'CLIENT_SECRET' or sent in as the second argument to the 'retrieve! method'.

IMPORTANT: Each authorization code can only be used to request an access token once, if Fortnox has received the code before it will deactivate any integration using the access token.

FortnoxAccessToken.new(authorization_code, client_secret:).retrieve!

About

Gem for fetching Fortnox access token with authorization code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages