ContributionsMost RecentMost LikesSolutionsAccessing Online File via API Hey guys, We've been using the MYOB API on local network for years. Unfortunately we're now forced to take our company file online. I've been playing around with the following PHP code to get our access code from MYOB. However, what happens is that the code redirects to a login page when I run the PHP code from our local server. I need to get the code automatically so we can then proceed with connecting to the company file API. Any idea how I can get the return code using PHP and without manually logging in each time an API request is made? We have apps that run every 30 mins so manually logging in each time an API call is made is not practical. Surely there's a better way? Thanks ------------------------------------------------------------------ $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_URL, "https://secure.myob.com/oauth2/account/authorize?client_id=mpednfsn3vgd4gqs3a3g86rr&redirect_uri=http%3A%2F%2Fdesktop&response_type=code&scope=CompanyFile"); curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); $result = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); print "$httpCode\n"; print "<p>$result</p>"; Re: Scheduled Jobs and Login using OAuth2 Hi - just came across your posts re MYOB Online for STP 2 and using APIs. I'm in the same boat. We have a suite of inhouse built PHP apps on our local server which use MYOB API. Been solid for many years but now have to go online - such a pain. How has testing gone for you with API connecting to your company file online instead of local network? I'm going to start testing ASAP. My personal email is khatib.michael@gmail.com if you'd like to connect and share ideas.