Startbeitrag von Sammy Broeders am 06.01.2017 08:27
Hello all,
I try to make a app in Windev20 to connect with the financial program Exact Online. In the beginning i need to make a Authentication request to receive a code, but i tried a lot of things but without any results. https://developers.exactonline.com/#OAuth_Tutorial.html%3FTocPath%3DSecurity%7CAuthorization%2520(Oauth%25202)%7C_____2
////
My last trie is as below;
cMyRequest is httpRequest
cMyRequest..URL = "https://start.exactonline.nl/api/oauth2/auth?response_type=code&client_id=3df696da-c188-45e5-87b4-afba5b9e0ff0&redirect_uri=http://www.sabrosoft.nl/&force_login=0"
cMyRequest..Method = httpGet
cMyRequest..User = "xx"
cMyRequest..Password = "xx"
cMyResponse is httpResponse = HTTPSend(cMyRequest)
IF ErrorOccurred THEN
Error(ErrorInfo(errFullDetails))
ELSE
EDT_NoName1 = cMyResponse..Content
END
Mayby anyone with experience in this case?
Thanks,
Sammy
I try to make a app in Windev20 to connect with the financial program Exact Online. In the beginning i need to make a Authentication request to receive a code, but i tried a lot of things but without any results. https://developers.exactonline.com/#OAuth_Tutorial.html%3FTocPath%3DSecurity%7CAuthorization%2520(Oauth%25202)%7C_____2
////
My last trie is as below;
cMyRequest is httpRequest
cMyRequest..URL = "https://start.exactonline.nl/api/oauth2/auth?response_type=code&client_id=3df696da-c188-45e5-87b4-afba5b9e0ff0&redirect_uri=http://www.sabrosoft.nl/&force_login=0"
cMyRequest..Method = httpGet
cMyRequest..User = "xx"
cMyRequest..Password = "xx"
cMyResponse is httpResponse = HTTPSend(cMyRequest)
IF ErrorOccurred THEN
Error(ErrorInfo(errFullDetails))
ELSE
EDT_NoName1 = cMyResponse..Content
END
Mayby anyone with experience in this case?
Thanks,
Sammy
Antworten:
First you have to get the authorization code from Exact online. We managed to do this by executing the URL in a HTML control. Wait until the URL is loaded. This is when we get the authorization code.
Then you have to get the 'Token' with HttpRequest and HttpGetResult
Kind regards,
Joris.
von Joris - am 06.01.2017 13:35
a bit off topic, but I was told by an Exact consultant that I had to join the partner program to use the API. Which he said was not free and time consuming (due to certification and so on) . Is that true?
We decided to use the import/export of CSV files to upload invoices and download some info. But the direct API is much more preferred.
von Arie - am 06.01.2017 14:51
At the moment i also use use the import of CSV files. At the link below you can make an account for apps and you get also a demo login for Exact Online.
https://apps.exactonline.com/?ReturnUrl=%2Fnl%2Fnl-NL%2FManage
And here you have the help file;
https://developers.exactonline.com/#OAuth_Tutorial.html%3FTocPath%3DSecurity%7CAuthorization%2520(Oauth%25202)%7C_____2
von Sammy Broeders - am 06.01.2017 14:56
Thanks for the reply.
How do you get the authorization code out of the html controle?
von Sammy Broeders - am 06.01.2017 14:57
I have extracted some of the code for you
Kind regards,
Joris
von Joris - am 09.01.2017 08:31
Thanks a lot for the code!
In this way the user needs to enter his username and password in the html controle every time, is that right?
von Sammy Broeders - am 09.01.2017 15:04
Yes indeed.
Joris.
von Joris - am 10.01.2017 08:53
Till the AccesToken it works ok, but after that i don`t receive anythink with the accestoken in my request. Do you use the accetoken also in this format;
Authorization=Bearer gAAAADrIc.......
So with "Authorization=Bearer " in the begin?
I use the request as below;
sUrl is string = "https://start.exactonline.nl/docs/XMLDivisions.aspx"
HTTPRequest(sUrl, "", AccesToken+CR,"","application/x-www-form-urlencoded", "", "")
antwoord is string = HTTPGetResult(httpHeader)
EDT_Antw = antwoord
Tanks,
Sammy
von Sammy Broeders - am 11.01.2017 17:48