Solved

Http connector Exact online

  • 19 November 2021
  • 32 replies
  • 1213 views

Userlevel 3
Badge +11

I’ve maganged to setup the connection to the Exact Online API from postman.

Now I try to setup the connection from the SF but we running into an invalid_request error as a result.

I’ve used the same input variables and keys, so at the moment I’ve not a clue why this result is happening:

 

 

 

 

 

 

Has anybody in the community succesfully connected to the Exact Online API.

 

icon

Best answer by Dick van den Brink 19 January 2022, 14:20

View original

32 replies

Userlevel 4
Badge +2

Hi Edwin,

Can you check the access token from Postman and the one you got back from the OAuth Refresh Connector with this website?
https://jwt.io/

I am curious if both are valid (and if there are differences). Of course the client_id and the expire time are different but the rest should be mostly the same.

Userlevel 4
Badge +2

I noticed the tokens Exact Online returns wont be valid in jwt.io, so that part of my reply can be ignored.

How do you use the access_token in the HTTP Connector?
I could get it to work by setting the HTTP method to GET and adding the following headers:

[ { "Key": "Accept", "Value": "application/json" }, { "Key": "Authorization", "Value": "Bearer {var_access_token}" } ]

I have a variable in my process flow called “var_access_token”.

Userlevel 3
Badge +11

Hi Dick, this is what I have in my headers.. 

[{"Key":"Authorization","Value":"Bearer {access_token}"}]

 

In the content_type: application/xml

In the content the variable where the reponse it stored

In the HTTP method; GET

And in the URL the: endpoint address


 

 

Userlevel 3
Badge +11

For exact: With a post you send JSON

With a get an XML is returned.

Userlevel 4
Badge +2

Exact Online can also return JSON from a GET request, with the right header as documented here.

https://support.exactonline.com/community/s/knowledge-base#All-All-DNO-Simulation-header-types

 

For the current issue, you said you could get the new codes and that after that it didn't work correctly anymore, specifically the access_token. Is the datatype for the access token long enough? (also in the process procedures?).

Also note, Exact Online doesn't allow refreshing the access token before 9 minutes and 30 seconds are passed, according to their documentation. So always calling the OAuth Refresh Token Connector might not work.

I am also working on a small guide, to make it more clear how to use the OAuth connectors, but it might take a while for me to finish.
 

 

Userlevel 3
Badge +11

Dick, It’s all working at the moment. I store the expiration datetime and when expired I do a refresh token call. That works fine. That’s only one extra step in all my process flows. And indeed somehow my process flow variable was set to 250 characters and the token is 700 so that’s fixed as well.

When it all works, it’s very simple, but to find out how how to get all the headers, tokens, json, input and output parameters in the right place in the right format is quite a challenge. 

I’m now setting up step by step all the endpoints. Accounts, BankAccounts, SalesEntries etc.

Userlevel 4
Badge +2

A new blog post is just released, maybe it provides some helpful extra information.

It is good to hear that everything is already working for you!

Regards,

Dick

Reply