RingCentral.Platform.Authenticate C# (CSharp) Method

Authenticate() public method

Do authentication with the authorization code returned from server
public Authenticate ( string authCode, string redirectUri ) : ApiResponse
authCode string The authorization code returned from server
redirectUri string The same redirectUri when you were obtaining the authCode in previous step
return RingCentral.Http.ApiResponse
        public ApiResponse Authenticate(string authCode, string redirectUri)
        {
            var request = new Request("/restapi/oauth/token",
                new Dictionary<string, string> { { "grant_type", "authorization_code" },
                    { "redirect_uri", redirectUri }, { "code", authCode } });
            var response = AuthCall(request);
            Auth.SetData(response.Json);
            _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Auth.AccessToken);
            return response;
        }