Trying to connect to API that must be authenticated with 0auth2.
Very good documentation from Sverigeledande på webbaserad bokföring och fakturering
Have tried the standard OAUTH 2 authentication but does not work.
I get to log in to Fortnox and accept the connection to app but then I get following response
untered an error (500):
{
"error": "{\"statusCode\":400,\"data\":\"{\\\"error\\\":\\\"invalid_grant\\\",\\\"error_description\\\":\\\"Authorization code doesn't exist or is invalid for the client\\\"}\"}",
"request": {
"url": "apps.fortnox.se/oauth-v1/token",
"method": "POST",
"headers": {
"Content-Type": "application/x-www-form-urlencoded",
"Host": "apps.fortnox.se",
"User-Agent": "Node-oauth",
"Content-Length": 151
},
"body": {
"grant_type": "authorization_code",
"redirect_uri": "https://oauth.retool.com/oauth/oauthcallback",
"client_id": "G8RZoNl1652x",
"client_secret": "---sanitized---",
"code": "---sanitized---"
}
}
}
Please try again
I guess it is because I must have State, Access_type and Response_type parameters in the authorisation request. Is that any way to add this without making a custom Api integration (which seems very complicated)