Get Access Token and Users

This sample code illustrates how to make a call to the OAuth 2.0 Tokens API using C# to get an access token. As a part of the sample use case, this code also illustrates how to use a generated OAuth 2.0 access token to make various GET calls to the Users API using C#.

This sample code uses RestSharp and JSON.NET (Newtonsoft.Json) third-party DLLs.

If you’re using the Generate Tokens v2 API or Refresh Tokens v2 API, replace the API endpoint in the sample with https://<subdomain>/auth/oauth2/v2/token