I am trying to use the C# SDK, within a console app to access Zoho without any luck.
All request are resulting in an error, can you please review and provide guidance
Also is there a way to use the Self clinet along wiith the C# SDK?
c#
===============================================================================================================
Dictionary<string, string> zohoConfig = new Dictionary<string, string>
{
{"client_id","1000.****"},
{"client_secret","***********************************"},
{"access_type","Bearer"},
{"persistence_handler_class","ZCRMSDK.OAuth.ClientApp.ZohoOAuthFilePersistence, ZCRMSDK"},
{"mysql_username",""},
{"mysql_password",""},
{"mysql_database",""},
{"mysql_server",""},
{"mysql_port",""},
{"oauth_tokens_file_path",@"C:\source\repos\ZohoTester\ZohoTester\bin\x64\Debug\Tokens\tok.txt"},
//{"apiBaseUrl",""},
{"photoUrl",""},
{"apiVersion","v2"},
{"logFilePath","" },
{"timeout",""},
{"minLogLevel",""},
{"domainSuffix","com"},
};
ZCRMRestClient.Initialize(zohoConfig);
/** Get Organization Data */
ZCRMRestClient restClient = ZCRMRestClient.GetInstance();
APIResponse response = restClient.GetOrganizationDetails();
Console.WriteLine(response.HttpStatusCode);
ZCRMOrganization organization = (ZCRMOrganization)response.Data
Log file
===============================================================================================================
19-11-24 00:07:40 [INFO]: Zoho OAuth Client Library configuration properties: {client_id : 1000.XXX, client_secret : XXX, redirect_uri :
https://www.callback.com/oauth, access_type : Bearer, persistence_handler_class : ZCRMSDK.OAuth.ClientApp.ZohoOAuthInMemoryPersistence, ZCRMSDK, oauth_tokens_file_path : C:\source\repos\ZohoTester\ZohoTester\bin\x64\Debug\Tokens\tok.txt, iamURL :
https://accounts.zoho.com}
19-11-24 00:07:40 [INFO]: Retreiving access token..
19-11-24 00:07:40 [ERROR]: Exception in Type: ZohoOAuthInMemoryPersistence at Method: ZCRMSDK.OAuth.Contract.ZohoOAuthTokens GetOAuthTokens(System.String) in File: at Line: 0
Exception in Type: ZohoOAuthClient at Method: System.String GetAccessToken(System.String) in File: at Line: 0
Exception of type 'ZCRMSDK.OAuth.Common.ZohoOAuthException' was thrown.
19-11-24 00:08:28 [INFO]: Zoho OAuth Client Library configuration properties: {client_id : 1000.XXXXXX, client_secret : XXXXXXXXXX, redirect_uri :
https://www.callback.com/oauth, access_type : Bearer, persistence_handler_class : ZCRMSDK.OAuth.ClientApp.ZohoOAuthFilePersistence, ZCRMSDK, oauth_tokens_file_path : C:\source\repos\ZohoTester\ZohoTester\bin\x64\Debug\Tokens\tok.txt, iamURL :
https://accounts.zoho.com}
19-11-24 00:08:28 [INFO]: Retreiving access token..
19-11-24 00:08:28 [ERROR]: Exception while fetching tokens from persistenceSystem.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at ZCRMSDK.OAuth.ClientApp.ZohoOAuthFilePersistence.GetOAuthTokens(String userMailId)
at ZCRMSDK.OAuth.Client.ZohoOAuthClient.GetAccessToken(String userMailId)
19-11-24 00:08:28 [ERROR]: Exception in Type: ZohoOAuthClient at Method: System.String GetAccessToken(System.String) in File: at Line: 0
Exception of type 'ZCRMSDK.OAuth.Common.ZohoOAuthException' was thrown.