Closed DCNetSolutions closed 4 years ago
I'm guessing we'd have to see the documentation/example on the way it is expecting the code to be sent?
Certainly zgrose, I should have included it, my apologies. The whole thing is here: https://developer.sage.com/api/accounting/guides/authentication/
However the specific is: POST https://oauth.accounting.sage.com/token Content-Type: application/x-www-form-urlencoded
client_id=4b6xxxxxxx710 &client_secret=iNuxxxxxxxxxxtm9 &code=12axxxxxxxxxxxxf7d &grant_type=authorization_code &redirect_uri=https://myapp.com/auth/callback
i don't recall off hand if the class will URLEncode for you, but so far looks right. If there are special characters in any of the parameters, try the post with a UrlEncode( ) around the parameter value?
Zgroses Et al.,
I fixed the issue, I was looking at the wrong token returned by Postman and also had grabbed the wrong grant_type. I guess to many hours looking and tunnel vision equals egg on my face. Seems like the only time I find my own errors is when I have put it out there for the world to see. I cannot thank you enough for your prompt replies Zgrose and Mr. Hall for this and the other great VBA code you have put out for the world to see and use and those who have contributed to make it even better.
Hello All,
I have been tasked with connecting our Access program with Sage Online Accounting software. I am struggling with getting the token. I am using the following code but receiving back the message: "The auth code you transmitted has an unexpected format". The code I am using:
I would greatly appreciate any help, I have been through the documentation and looked for answers elsewhere first before asking here. (Note: The authorization code I am pulling from a request from Postman.)
Thank you.