public static string GetAccessToken() { string userMailId = ZCRMRestClient.GetCurrentUserEmail(); if ((userMailId == null) && (!(ConfigProperties.ContainsKey(APIConstants.CURRENT_USER_EMAIL)) || (ConfigProperties[APIConstants.CURRENT_USER_EMAIL] == null))) { throw new ZCRMException("Current user must be either set in ZCRMRestClient or zcrm_configuration dictionary"); } if (userMailId == null) { userMailId = ConfigProperties[APIConstants.CURRENT_USER_EMAIL]; } ZohoOAuthClient client = ZohoOAuthClient.GetInstance(); return(client.GetAccessToken(userMailId)); }
public static string GetAccessToken() { string userMailId = ZCRMRestClient.GetCurrentUserEmail(); if ((userMailId == null) && (!(ConfigProperties.ContainsKey("currentUserEmail")) || (ConfigProperties["currentUserEmail"] == null))) { throw new ZCRMException("Current user must be either set in ZCRMRestClient or zcrm_configuration section in zoho_configuration.config"); } if (userMailId == null) { userMailId = ConfigProperties["currentUserEmail"]; } ZohoOAuthClient client = ZohoOAuthClient.GetInstance(); return(client.GetAccessToken(userMailId)); }