ZCRMSDK 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package ZCRMSDK --version 1.0.1
NuGet\Install-Package ZCRMSDK -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ZCRMSDK" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ZCRMSDK --version 1.0.1
#r "nuget: ZCRMSDK, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ZCRMSDK as a Cake Addin
#addin nuget:?package=ZCRMSDK&version=1.0.1

// Install ZCRMSDK as a Cake Tool
#tool nuget:?package=ZCRMSDK&version=1.0.1

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:

  1. Visit this page https://accounts.zoho.com/developerconsole.
  2. Click on Add Client ID.
  3. Enter Client Name, Client Domain and Redirect URI.
  4. Select the Client Type as Web based.
  5. 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 OptionsEdit.
(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 and redirect_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 the mysql_username and mysql_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 be

    • https://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 be

    • https://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 be

    • https://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 are ALL, INFO, WARNING, ERROR and OFF. The default minimum log level is WARNING.

  • 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 365 4/19/2021
3.1.0 13,969 5/17/2021
3.0.1 7,663 1/5/2021
3.0.0 1,018 11/30/2020
2.2.4 27,604 8/23/2021
2.2.3 17,673 9/10/2020
2.2.2 3,755 7/2/2020
2.2.1 7,087 6/27/2020
2.2.0 1,284 6/10/2020
2.1.9 2,819 5/7/2020
2.1.8 805 4/27/2020
2.1.7 2,437 3/27/2020
2.1.6 598 3/23/2020
2.1.5 2,015 2/21/2020
2.1.4 1,998 1/27/2020
2.1.2 1,775 12/26/2019
2.1.1 727 12/26/2019
2.1.0 920 12/17/2019
2.0.9 14,360 11/18/2019
2.0.8 700 11/14/2019
2.0.7 769 11/6/2019
2.0.6 674 10/31/2019
2.0.5 1,364 10/9/2019
2.0.4 2,050 9/12/2019
2.0.3 1,277 8/27/2019
2.0.2 7,886 5/22/2019
2.0.1 1,172 4/24/2019
1.0.4 8,284 2/1/2019
1.0.3 839 1/24/2019
1.0.2 1,578 1/17/2019
1.0.1 1,373 1/11/2019
1.0.0 805 1/3/2019

Support is given for Organization Tax API.