frebin francis Posted March 1, 2022 Share Posted March 1, 2022 (edited) I need to call the sage 50 APIs for getting and posting data from a background service. So is there any way we can get a token (with a much higher expiry period) for accounting API without invoking the Sage 50 login screen since I want to call these APIs not from the UI side but from the background process. Thanks, frebin Edited March 1, 2022 by frebin francis Link to comment Share on other sites More sharing options...
Administrators Ben Smith Posted March 4, 2022 Administrators Share Posted March 4, 2022 Hi Frebin, Just to clarify - are you referring to Sage Business Cloud Accounting? This is our cloud native app with a RESTful API as opposed to Sage 50cloud Accounts which is a desktop application with a .NET SDK. I assume you mean Sage Business Cloud Accounting, and if so at present there's no way to extend the token lifetime. What we'd recommend is essentially maintaining a connection through the use of the refresh token, checking that your existing access token is valid prior to making your calls, and if not exchanging the refresh for a new access token. You can read more on how to do that here. Ben Link to comment Share on other sites More sharing options...
frebin francis Posted March 4, 2022 Author Share Posted March 4, 2022 4 hours ago, Ben Smith said: Hi Frebin, Just to clarify - are you referring to Sage Business Cloud Accounting? This is our cloud native app with a RESTful API as opposed to Sage 50cloud Accounts which is a desktop application with a .NET SDK. I assume you mean Sage Business Cloud Accounting, and if so at present there's no way to extend the token lifetime. What we'd recommend is essentially maintaining a connection through the use of the refresh token, checking that your existing access token is valid prior to making your calls, and if not exchanging the refresh for a new access token. You can read more on how to do that here. Ben Thanks for your reply Ben. Yes I'm referring to Sage Business Cloud Accounting. Just wanted to know can I get a token without a login page in between (By passing user credentials with the other request parameters) since I want to call this API from backend service. 1 Link to comment Share on other sites More sharing options...
Yanika Abela Posted August 2, 2023 Share Posted August 2, 2023 Hi @frebin francis, did you manage to solve this eventually? We're looking to do the same thing. Looking forward for your reply! Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now