ZCRMSDK 1.0.3
See the version list below for details.
dotnet add package ZCRMSDK --version 1.0.3
NuGet\Install-Package ZCRMSDK -Version 1.0.3
<PackageReference Include="ZCRMSDK" Version="1.0.3" />
paket add ZCRMSDK --version 1.0.3
#r "nuget: ZCRMSDK, 1.0.3"
// Install ZCRMSDK as a Cake Addin #addin nuget:?package=ZCRMSDK&version=1.0.3 // Install ZCRMSDK as a Cake Tool #tool nuget:?package=ZCRMSDK&version=1.0.3
C# SDK for Zoho CRM
C# SDK for Zoho CRM APIs provides wrapper for Zoho CRM APIs. Hence, invoking a Zoho CRM API from your client C# application is only a method call.
Registering a Zoho Client
Since Zoho CRM APIs are authenticated with OAuth2 standards, you should register your client app with Zoho. To register your app:
- Visit this page https://accounts.zoho.com/developerconsole.
- Click on
Add Client ID
. - Enter
Client Name
,Client Domain
andRedirect URI
. - Select the
Client Type
asWeb based
. - Click
Create
.
Your Client app would have been created and displayed by now.
The newly registered app's Client ID
and Client Secret
can be found by clicking Options
→ Edit
.
(Options is the three dot icon at the right corner).
Setting Up
C# SDK is available as a Nuget
Package. The ZCRMSDK
Assembly can be installed through Nuget Package Manager
and through the following options:
Package Manager:
>Install-Package ZCRMSDK --version 1.0.0/
.NET CLI:
>dotnet add package ZCRMSDK --version 1.0.0/
Note: The C# SDK is built against for .net standard 2.0.
Configurations
Your OAuth Client details should be given to the SDK as a section in app.config file. Add a section oauth_configuration in the app.config file and make sure that the section has the attribute type as ZCRMSDK.CRM.Library.Common.ConfigFileHandler.ConfigFileSection, ZCRMSDK
. It is illustrated in the example below.
<configuration>
<configSections>
<section name="oauth_configuration" type="ZCRMSDK.CRM.Library.Common.ConfigFileHandler.ConfigFileSection, ZCRMSDK"></section>
<section name="zcrm_configuration" type="ZCRMSDK.CRM.Library.Common.ConfigFileHandler.ConfigFileSection, ZCRMSDK"></section>
</configSections>
<oauth_configuration>
<settings>
<add key = "client_id" value = "" />
<add key = "client_secret" value = "" />
<add key = "redirect_uri" value = "" />
<add key = "access_type" value = "offline"/>
<add key = "persistence_handler_class" value = ""/>
<add key = "oauth_tokens_file_path" value = ""/>
<add key = "mysql_username" value = "root"/>
<add key = "mysql_password" value = ""/>
<add key = "mysql_database" value = "zohooauth"/>
<add key = "mysql_server" value = "localhost"/>
<add key = "mysql_port" value = "3306"/>
<add key = "iamURL" value = ""/>
</settings>
</oauth_configuration>
<zcrm_configuration>
<settings>
<add key = "apiBaseUrl" value = ""/>
<add key = "photoUrl" value = ""/>
<add key = "apiVersion" value = "v2"/>
<add key = "loginAuthClass" value = ""/>
<add key = "logFilePath" value = ""/>
<add key = "timeout" value = ""/>
<add key = "minLogLevel" value = ""/>
<add key = "domainSuffix" value = ""/>
<add key = "currentUserEmail" value = "" />
</settings>
</zcrm_configuration>
</configuration>
client_id
,client_secret
andredirect_uri
are your OAuth client’s configurations that you get after registering your Zoho client.access_type
will be set to offline by default. Access and Refresh tokens will be received only when it is offline.persistence_handler_class
is your implementation of the IZohoPersistenceHandler interface, which has handler methods to store OAuth data. This is discussed in the next section. For example:persistence_handler_class=ZCRMSDK.OAuth.ClientApp.ZohoOAuthFilePersistence, ZCRMSDK
(or)ZCRMSDK.OAuth.ClientApp.ZohoOAuthDBPersistence, ZCRMSDK
(or) your own persistence handler class.If you prefer to use our DB persistence (
ZohoOAuthDBPersistence.cs
) , you need to give themysql_username
andmysql_password
keys for mysql connectivity.By default, mysql_username = "root", mysql_password = "", mysql_database = "zohooauth", mysql_server = "localhost" and mysql_port = "3306".
The tokens are generated and placed in the database table automatically(which is explained in the ZohoOauthDBPersistence section) once the authentication process is complete.
The
oauth_tokens_file_path
is required if the SDK's File Persistence is used as the persistence handler. It is the path of the file for storing the tokens of the user.iamURL
- Url to be used when calling an Oauth accounts. It is used to denote the domain of the user. Url may behttps://accounts.zoho.com
for US.https://accounts.zoho.eu
for European countries.https://accounts.zoho.com.cn
for China.
Other than the above OAuth configurations, the SDK also provides options to override certain HTTP request attributes. These configurations should be provided under a section named zcrm_configuration
, in the app.config file.
The type of the section should be ZCRMSDK.CRM.Library.Common.ConfigFileHandler.ConfigFileSection, ZCRMSDK
.
The following are the supported configurations in the zcrm_configuration section:
apiBaseUrl
- Url to be used when calling an API. It is used to denote the domain of the user. Url may behttps://www.zohoapis.com
for US.https://www.zohoapis.eu
for European countries.https://www.zohoapis.com.cn
for China.
photoUrl
- Url for the image representing the record. The domain might be different based on the apiBaseUrl. Url may behttps://profile.zoho.com/api/v1/user/self/photo
for US.https://profile.zoho.eu/api/v1/user/self/photo
for European countries.https://profile.zoho.com.cn/api/v1/user/self/photo
for China.
apiVersion
is "v2".timeOut
- Represents the request timeout in milliseconds. Let this be omitted or empty if not needed.minLogLevel
- Represents the minimum log level for logging of SDK. The supported values areALL
,INFO
,WARNING
,ERROR
andOFF
. The default minimum log level isWARNING
.logFilePath
- Represents the file to which the SDK can log. Optional configuration and can be omitted. If omitted, the SDK logs the working in the execution directory of the application under the filename LogFile.log. Only the path of the file, without the file name, is needed for storing the logs.currentUserEmail
- In case of single user, this configuration can be set. This user email is use fetch the corresponding access token from the persistance.domainSuffix
- Optional configuraion. Provides Multi-DC Support. Ex: com, eu or cn.Note: If the file path for "logFilePath" is not specified, then the "logFile.log" is created in the "{Project}/bin/Debug/netcoreapp2.1/" folder of the project.
App Startup
The SDK requires the following line of code being invoked every time your app gets started.
ZCRMRestClient.Initialize();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.NET.Test.Sdk (>= 15.9.0)
- MySql.Data (>= 8.0.14)
- Newtonsoft.Json (>= 12.0.1)
- System.Configuration.ConfigurationManager (>= 4.5.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
4.0.0-beta | 406 | 4/19/2021 |
3.1.0 | 17,207 | 5/17/2021 |
3.0.1 | 7,764 | 1/5/2021 |
3.0.0 | 1,088 | 11/30/2020 |
2.2.4 | 33,236 | 8/23/2021 |
2.2.3 | 20,695 | 9/10/2020 |
2.2.2 | 4,831 | 7/2/2020 |
2.2.1 | 7,125 | 6/27/2020 |
2.2.0 | 1,337 | 6/10/2020 |
2.1.9 | 3,016 | 5/7/2020 |
2.1.8 | 838 | 4/27/2020 |
2.1.7 | 2,600 | 3/27/2020 |
2.1.6 | 623 | 3/23/2020 |
2.1.5 | 2,394 | 2/21/2020 |
2.1.4 | 2,453 | 1/27/2020 |
2.1.2 | 1,824 | 12/26/2019 |
2.1.1 | 763 | 12/26/2019 |
2.1.0 | 961 | 12/17/2019 |
2.0.9 | 17,182 | 11/18/2019 |
2.0.8 | 735 | 11/14/2019 |
2.0.7 | 799 | 11/6/2019 |
2.0.6 | 706 | 10/31/2019 |
2.0.5 | 1,402 | 10/9/2019 |
2.0.4 | 2,084 | 9/12/2019 |
2.0.3 | 1,321 | 8/27/2019 |
2.0.2 | 7,925 | 5/22/2019 |
2.0.1 | 2,094 | 4/24/2019 |
1.0.4 | 11,908 | 2/1/2019 |
1.0.3 | 869 | 1/24/2019 |
1.0.2 | 1,647 | 1/17/2019 |
1.0.1 | 1,409 | 1/11/2019 |
1.0.0 | 847 | 1/3/2019 |
Fix for the exception "exePath must be specified when not running inside a stand alone exe" in ASP.NET web applications.