GTW has updated their API and I'm in the middle of refactoring some code to accommodate these required changes but I'm a little stuck on the Auth Token part.
As per their instructions (https://goto-developer.logmeininc.com/how-get-access-token-and-organizer-key):
1 - Request Authorization Code Create an authorization request on behalf of a GoTo product user. It sends them to a product login page.
In the My Apps page, open your application and copy the Consumer Key value. Insert the Consumer Key value into the following URL to replace {consumerKey}: https://api.getgo.com/oauth/v2/authorize?client_id={consumerKey}&response_type=code The product account holder sends the URL. They are directed to the sign-in page for the product. If they are not already logged in, they sign in with their credentials and must click Allow to allow access for the developer application. The user is then automatically redirected to the redirect URL you defined in the developer center application. The redirect URI (in the browser address bar) has a Response Key added to it.
IMPORTANT: You may see an error on the page such as 404 NOT FOUND. This is not a problem. Look at the URL in the browser. It contains the responseKey you need for the next step. It will look something like:
http://example.com/oauthreturn/?code={responseKey} You can include an optional redirect URI and/or a state parameter. For details, see the section, Optional: Add a Redirect URI, below.
Of most interest here is this line:
IMPORTANT: You may see an error on the page such as 404 NOT FOUND. This is not a problem. Look at the URL in the browser. It contains the responseKey you need for the next step. It will look something like:
It actually works just fine if I do this in a browser...I provide the appropriate credentials and I'm redirected to what amounts to an error page (and a header code of 404 is returned) but the URL contains the auth token.
I'm trying to retrieve this auth token with CURL but I can't actually get the redirected URL in any data that is returned from the CURL request.
If you prefer to handle the auth process yourself, please have a look at the implementation in this repo:
https://github.com/cleverreach/citrix
Since the package handles the entire process I'd suggest using it as is, but if you prefer to implement your own, it's still a great example and a helpful starting point.