GoTo
API Status
GoTo

.NET SDK

The SDKs do NOT support:

  • GoToAssist Service Desk
  • GoToAssist Remote Support
  • GoToAssist Corporate
  • Admin
  • SCIM

The available SDKs are licensed under the SDK License Agreement.

Requirements

All SDKs require .NET Framework 4.0 or higher and are dependent upon Json.NET by James Newton-King.

Installation

Install from the NuGet Gallery

All SDKs are available as packages on the NuGet gallery. To install them use the Package Manager Dialog or run from the Package Manager Console:

PM> Install-Package LogMeIn.GoToMeeting.NET
PM> Install-Package LogMeIn.GoToWebinar.NET
PM> Install-Package LogMeIn.GoToTraining.NET
PM> Install-Package LogMeIn.GoToCoreLib.NET

Each of the above commands will install the respective SDK and the Json.NET dependency.

Latest Versions

Package Version
LogMeIn.GoToMeeting.NET 1.2.0
LogMeIn.GoToWebinar.NET 2.7.0
LogMeIn.GoToTraining.NET 1.1.0
LogMeIn.GoToCoreLib.NET 2.2.0

Getting started

The following tips assume that you already have

  • a GoTo product account
  • a GoTo developer account
  • a client ID for the respective GoTo product. You obtain this ID after creating a client in your developer account.

If you do not, please refer to steps 1-3 of our Getting started guide.

To integrate the GoTo product into your application you need to install the homonymous SDK as well as the core library for authentication. For example, to develop for GoToWebinar, you need to install GoToWebinar.NET and GoToCoreLib.NET.

Before you make any calls you need to authenticate and obtain an access token.

OAuth Flow

The first step is to generate the authorization URL where the user's browser will be directed. For this you'll need your app's client ID and optionally the URL where the user will be redirected after the authorization to use your application:

using LogMeIn.GoToCoreLib.Api;
...
string clientId = "nMf9SaIASQ7Jy94Ehyq8GcyopR4MQSbp";
string clientSecret = "loHznAxTuXGfFaMQ";
var oauth2Api = new OAuth2Api(clientId, clientSecret);
string authUrl = oauth2Api.GetOAuth2AuthorisationUrl(); // => "https://api.getgo.com/oauth/v2/authorize?client_id=nMf9SaIASQ7Jy94Ehyq8GcyopR4MQSbp&response_type=code"

Then you need to direct your user's browser to this authorization URL. The user will now login with their GoTo product account credentials and click "Approve" to allow your application access to their product data. After approval, the user will be redirected and you need to capture this redirection URL in order to extract from it the OAuth flow response key. You will use the latter to obtain your access token, for example:

/* using a WinForms WebBrowser implementation */
void webBrowser_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
    string responseKey = oauth2Api.GetResponseKey(e.Url); // => "a2647d1379894cc2001eb31689cacccc"
    var tokenResponse = oauth2Api.GetAccessTokenResponse(responseKey);
    var accessToken = tokenResponse.access_token; // => "RlUe11faKeyCWxZToK3nk0uTKAL"
}

Direct Login (Deprecated)

This authentication API is now deprecated. All new clients will not be able to use this API. If you have a client for which the direct login works, that will continue to work for now.

using LogMeIn.GoToCoreLib.Api;
...
string userName = "test@test.com";
string userPassword = "abcxyz";
string clientId = "nMf9SaIASQ7Jy94Ehyq8GcyopR4MQSbp";
string clientSecret = "loHznAxTuXGfFaMQ";
var authApi = new OAuth2Api(clientId, clientSecret);
var tokenResponse = authApi.directLogin(userName, userPassword);
var accessToken = tokenResponse.access_token; // => "RlUe11faKeyCWxZToK3nk0uTKAL"

Token Refresh

When you get an access token, the response also includes a refresh token. At the end of your access token's lifetime, you can send the refresh token in a call to obtain a new access token and refresh token pair:

var refreshToken = tokenResponse.refresh_token; // => "d1cp20yB3hrFAKeTokenTr49EZ34kTvNK"
tokenResponse = authApi.GetAccessTokenUsingRefreshToken(refreshToken)

Further calls

Once you have obtained your access token you can perform any other call passing in the access token as a parameter. For example, to list the starting times of all scheduled meetings:

using LogMeIn.GoToMeeting.Api;
...
var meetingsApi = new MeetingsApi();
var meetings = meetingsApi.getUpcomingMeetings(accessToken);
meetings.ForEach(m => Trace.WriteLine(m.startTime));