diff --git a/README.md b/README.md
index 69c3fe5..c404716 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,10 @@ License
## Latest Version
+- [3.0.0](/versions/3.0.0/README.md)
+
+ - Handle "text/plain" content type as file download.
+
- [2.0.0](/versions/2.0.0/README.md)
- Handled Error Structure in MassDeleteTags API.
@@ -63,7 +67,7 @@ You can include the SDK to your project using:
- Package Manager
```sh
- Install-Package ZOHOCRMSDK-7.0 -Version 2.0.0
+ Install-Package ZOHOCRMSDK-7.0 -Version 3.0.0
Install-Package MySql.Data -Version 6.9.12
Install-Package Newtonsoft.Json -Version 13.0.1
```
@@ -71,7 +75,7 @@ You can include the SDK to your project using:
- .NET CLI
```sh
- dotnet add package ZOHOCRMSDK-7.0 --version 2.0.0
+ dotnet add package ZOHOCRMSDK-7.0 --version 3.0.0
dotnet add package Newtonsoft.Json --version 13.0.1
dotnet add package MySql.Data --version 6.9.12
```
@@ -82,7 +86,7 @@ You can include the SDK to your project using:
```sh
-
+
@@ -102,4 +106,4 @@ For example, if you generate the tokens for your Sandbox environment in the CN d
---
-For more details, kindly refer [here](/versions/2.0.0/ZohoCRM/README.md).
\ No newline at end of file
+For more details, kindly refer [here](/versions/3.0.0/ZohoCRM/README.md).
\ No newline at end of file
diff --git a/ZohoCRM/Com/Zoho/Crm/API/Util/CommonAPIHandler.cs b/ZohoCRM/Com/Zoho/Crm/API/Util/CommonAPIHandler.cs
index 12d8d9e..bdf3e69 100644
--- a/ZohoCRM/Com/Zoho/Crm/API/Util/CommonAPIHandler.cs
+++ b/ZohoCRM/Com/Zoho/Crm/API/Util/CommonAPIHandler.cs
@@ -326,13 +326,12 @@ public Converter GetConverterClassInstance(string encodeType)
case "application/json":
case "application/ld+json":
return new JSONConverter(this);
- case "text/plain":
- return new TextConverter(this);
case "application/xml":
case "text/xml":
return new XMLConverter(this);
case "multipart/form-data":
return new FormDataConverter(this);
+ case "text/plain":
case "image/png":
case "image/jpeg":
case "image/gif":
diff --git a/ZohoCRM/Com/Zoho/Crm/API/Util/Constants.cs b/ZohoCRM/Com/Zoho/Crm/API/Util/Constants.cs
index f0abdb5..a991d25 100644
--- a/ZohoCRM/Com/Zoho/Crm/API/Util/Constants.cs
+++ b/ZohoCRM/Com/Zoho/Crm/API/Util/Constants.cs
@@ -55,7 +55,7 @@ public static class Constants
public static readonly string LOG_FILE_NAME = "sdk_logs.log";
public static readonly string TOKEN_FILE = "sdk_tokens.txt";
public static readonly string ZOHO_SDK = "X-ZOHO-SDK";
- public static readonly string SDK_VERSION = "2.0.0";
+ public static readonly string SDK_VERSION = "3.0.0";
public static readonly string MODULEPACKAGENAME = "modulePackageName";
public static readonly string MODULEDETAILS = "moduleDetails";
public static readonly string DATATYPECONVERTER = "Com.Zoho.Crm.API.Util.DataTypeConverter`1[[$type]], ZOHOCRMSDK-7.0";
diff --git a/ZohoCRM/Com/Zoho/Crm/API/Util/Utility.cs b/ZohoCRM/Com/Zoho/Crm/API/Util/Utility.cs
index 45161fb..b2d9a09 100644
--- a/ZohoCRM/Com/Zoho/Crm/API/Util/Utility.cs
+++ b/ZohoCRM/Com/Zoho/Crm/API/Util/Utility.cs
@@ -28,7 +28,7 @@ public class Utility
private static Dictionary apiTypeVsDataType = new Dictionary();
private static Dictionary apiTypeVsStructureName = new Dictionary();
private static bool newFile = false;
- private static bool getModifiedModules = false;
+ private static bool getModifiedModules = false;
private static bool forceRefresh = false;
private static string moduleAPIName;
private static JObject apiSupportedModule = new JObject();
diff --git a/ZohoCRM/README.md b/ZohoCRM/README.md
index 67bd421..4f48dd8 100755
--- a/ZohoCRM/README.md
+++ b/ZohoCRM/README.md
@@ -74,7 +74,7 @@ You can include the SDK to your project using:
- Package Manager
```sh
- Install-Package ZOHOCRMSDK-7.0 -Version 2.0.0
+ Install-Package ZOHOCRMSDK-7.0 -Version 3.0.0
Install-Package MySql.Data -Version 6.9.12
Install-Package Newtonsoft.Json -Version 13.0.1
```
@@ -82,7 +82,7 @@ You can include the SDK to your project using:
- .NET CLI
```sh
- dotnet add package ZOHOCRMSDK-7.0 --version 2.0.0
+ dotnet add package ZOHOCRMSDK-7.0 --version 3.0.0
dotnet add package Newtonsoft.Json --version 13.0.1
dotnet add package MySql.Data --version 6.9.12
```
@@ -93,7 +93,7 @@ You can include the SDK to your project using:
```sh
-
+
diff --git a/ZohoCRM/ZOHOCRMSDK-7.0.csproj b/ZohoCRM/ZOHOCRMSDK-7.0.csproj
index cddcaec..51ecba3 100644
--- a/ZohoCRM/ZOHOCRMSDK-7.0.csproj
+++ b/ZohoCRM/ZOHOCRMSDK-7.0.csproj
@@ -19,7 +19,7 @@
true
en-US
ZOHOCRMSDK-7.0
- 2.0.0
+ 3.0.0
Zoho CRM API Team
Zoho CRM API Team
Provides C# SDK support for Zoho CRM APIs.
diff --git a/ZohoCRM/readme.txt b/ZohoCRM/readme.txt
index a7d5885..1d3cbf6 100644
--- a/ZohoCRM/readme.txt
+++ b/ZohoCRM/readme.txt
@@ -1,14 +1,14 @@
————————————————————————
-Zoho CRM C# SDK 2.0.0
+Zoho CRM C# SDK 3.0.0
————————————————————————
-This is the readme file for Zoho CRM’s C# SDK version 2.0.0.
+This is the readme file for Zoho CRM’s C# SDK version 3.0.0.
This file gives a brief of the enhancements and/or bug fixes in the latest version.
----------------
Enhancements
----------------
- - Handled Error Structure in MassDeleteTags API.
+ - Handle "text/plain" content type as file download
You can also take a look at our GitHub page here (https://github.com/zoho/zohocrm-csharp-sdk-7.0/blob/master/README.md)
\ No newline at end of file
diff --git a/versions/3.0.0/Samples/APIS/GetSupportedAPI.cs b/versions/3.0.0/Samples/APIS/GetSupportedAPI.cs
new file mode 100644
index 0000000..62726df
--- /dev/null
+++ b/versions/3.0.0/Samples/APIS/GetSupportedAPI.cs
@@ -0,0 +1,99 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using Com.Zoho.API.Authenticator;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using Com.Zoho.Crm.API.Util;
+using Com.Zoho.Crm.API.Dc;
+using Newtonsoft.Json;
+using Com.Zoho.Crm.API.APIs;
+
+namespace Samples.APIS
+{
+ public class GetSupportedAPI
+ {
+ public static void GetSupportedAPI_1()
+ {
+ String filters = null;
+ APIsOperations apisOperations = new APIsOperations(filters);
+ APIResponse response = apisOperations.GetSupportedAPI();
+ if (response != null)
+ {
+ Console.WriteLine("Status Code: " + response.StatusCode);
+ if (new List() { 204, 304 }.Contains(response.StatusCode))
+ {
+ Console.WriteLine(response.StatusCode == 204 ? "No Content" : "Not Modified");
+ return;
+ }
+ if (response.IsExpected)
+ {
+ ResponseHandler responseHandler = response.Object;
+ if (responseHandler is ResponseWrapper)
+ {
+ ResponseWrapper responseWrapper = (ResponseWrapper)responseHandler;
+ List apis = responseWrapper.Apis;
+ foreach (SupportedAPI api in apis)
+ {
+ Console.WriteLine("API Path : " + api.Path);
+ List operationTypes = api.OperationTypes;
+ foreach (OperationTypes operationType in operationTypes)
+ {
+ Console.WriteLine("API Operation Method : " + operationType.Method);
+ Console.WriteLine("API Operation OAuthScope : " + operationType.OauthScope);
+ Console.WriteLine("API Operation MaxCredits : " + operationType.MaxCredits);
+ Console.WriteLine("API Operation MinCredits : " + operationType.MinCredits);
+ }
+ }
+ }
+ else if (responseHandler is APIException)
+ {
+ APIException exception = (APIException)responseHandler;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ System.Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL").Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ GetSupportedAPI_1();
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
+
diff --git a/versions/3.0.0/Samples/AuditLogExport1/CreateAuditlogExport.cs b/versions/3.0.0/Samples/AuditLogExport1/CreateAuditlogExport.cs
new file mode 100644
index 0000000..c152b49
--- /dev/null
+++ b/versions/3.0.0/Samples/AuditLogExport1/CreateAuditlogExport.cs
@@ -0,0 +1,125 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using Com.Zoho.API.Authenticator;
+using Com.Zoho.Crm.API.AuditLogExport;
+using Com.Zoho.Crm.API.Dc;
+using Com.Zoho.Crm.API.Util;
+using Newtonsoft.Json;
+
+namespace Samples.AuditLogExport1
+{
+ public class CreateAuditlogExport
+ {
+ public static void CreateAuditlogExport_1()
+ {
+ AuditLogExportOperations auditLogExportOperations = new AuditLogExportOperations();
+ BodyWrapper request = new BodyWrapper();
+ List auditLogExport = new List();
+ AuditLogExport auditLogExport1 = new AuditLogExport();
+ Criteria criteria = new Criteria();
+ criteria.Comparator = "between";
+ Field field = new Field();
+ field.APIName = "audited_time";
+ criteria.Field = field;
+ List values = new List();
+ values.Add(new DateTimeOffset(new DateTime(2020, 05, 15, 12, 0, 0, DateTimeKind.Local)));
+ values.Add(new DateTimeOffset(new DateTime(2020, 05, 15, 12, 0, 0, DateTimeKind.Local)));
+ criteria.Value = values;
+ auditLogExport1.Criteria = criteria;
+ auditLogExport.Add(auditLogExport1);
+ request.AuditLogExport = auditLogExport;
+ APIResponse response = auditLogExportOperations.CreateAuditlogExport(request);
+ if (response != null)
+ {
+ Console.WriteLine("Status Code: " + response.StatusCode);
+ if (response.IsExpected)
+ {
+ ActionHandler actionHandler = response.Object;
+ if (actionHandler is ActionWrapper)
+ {
+ ActionWrapper actionWrapper = (ActionWrapper)actionHandler;
+ List actionresponses = actionWrapper.AuditLogExport;
+ foreach (ActionResponse actionresponse in actionresponses)
+ {
+ if (actionresponse is SuccessResponse)
+ {
+ SuccessResponse successresponse = (SuccessResponse)actionresponse;
+ Console.WriteLine("Status: " + successresponse.Status.Value);
+ Console.WriteLine("Code: " + successresponse.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in successresponse.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + successresponse.Message);
+ }
+ else if (actionresponse is APIException)
+ {
+ APIException exception = (APIException)actionresponse;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message);
+ }
+ }
+
+ }
+ else if (actionHandler is APIException)
+ {
+ APIException exception = (APIException)actionHandler;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ System.Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL").Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ CreateAuditlogExport_1();
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+}
+}
+
diff --git a/versions/3.0.0/Samples/AuditLogExport1/GetExportedAuditlog.cs b/versions/3.0.0/Samples/AuditLogExport1/GetExportedAuditlog.cs
new file mode 100644
index 0000000..3cb30d0
--- /dev/null
+++ b/versions/3.0.0/Samples/AuditLogExport1/GetExportedAuditlog.cs
@@ -0,0 +1,141 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using Com.Zoho.API.Authenticator;
+using Com.Zoho.Crm.API.AuditLogExport;
+using Com.Zoho.Crm.API.Dc;
+using Com.Zoho.Crm.API.Util;
+using Newtonsoft.Json;
+
+namespace Samples.AuditLogExport1
+{
+ public class GetExportedAuditlog
+ {
+ public static void GetExportedAuditlog_1(long Id)
+ {
+ AuditLogExportOperations auditLogExportOperations = new AuditLogExportOperations();
+ APIResponse response = auditLogExportOperations.GetExportedAuditlog(Id);
+ if (response != null)
+ {
+ Console.WriteLine("Status Code: " + response.StatusCode);
+ if (response.IsExpected)
+ {
+ ResponseHandler actionHandler = response.Object;
+ if (actionHandler is ResponseWrapper)
+ {
+ ResponseWrapper responseWrapper = (ResponseWrapper)actionHandler;
+ List auditLogExport = responseWrapper.AuditLogExport;
+ if (auditLogExport != null)
+ {
+ foreach (AuditLogExport auditLogExport1 in auditLogExport)
+ {
+ Criteria criteria = auditLogExport1.Criteria;
+ if (criteria != null)
+ {
+ PrintCriteria(criteria);
+ }
+ Console.WriteLine("AuditLogExport Id : " + auditLogExport1.Id);
+ Console.WriteLine("AuditLogExport Status : " + auditLogExport1.Status);
+ User createdBy = auditLogExport1.CreatedBy;
+ if(createdBy != null)
+ {
+ Console.WriteLine("AuditLogExport User Id : " + createdBy.Id);
+ Console.WriteLine("AuditLogExport User Id : " + createdBy.Name);
+ }
+ List downloadLinks = auditLogExport1.DownloadLinks;
+ if(downloadLinks != null)
+ {
+ foreach (String link in downloadLinks)
+ {
+ Console.WriteLine("AuditLogExport DownloadLink : " + link);
+ }
+ }
+ Console.WriteLine("AuditLogExport JobStartTime : " + auditLogExport1.JobStartTime);
+ Console.WriteLine("AuditLogExport JobEndTime : " + auditLogExport1.JobEndTime);
+ Console.WriteLine("AuditLogExport ExpiryDate : " + auditLogExport1.ExpiryDate);
+ }
+ }
+ }
+ else if (actionHandler is APIException)
+ {
+ APIException exception = (APIException)actionHandler;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ System.Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+
+ private static void PrintCriteria(Criteria criteria)
+ {
+ if (criteria.Comparator != null)
+ {
+ Console.WriteLine("ExportedAuditlogs Criteria Comparator: " + criteria.Comparator);
+ }
+ if (criteria.Value != null)
+ {
+ Console.WriteLine("ExportedAuditlogs Criteria Value: " + criteria.Value);
+ }
+ if (criteria.Field != null)
+ {
+ Console.WriteLine("ExportedAuditlogs Criteria field name: " + criteria.Field.APIName);
+ }
+ List criteriaGroup = criteria.Group;
+ if (criteriaGroup != null)
+ {
+ foreach (Criteria criteria1 in criteriaGroup)
+ {
+ PrintCriteria(criteria1);
+ }
+ }
+ if (criteria.GroupOperator != null)
+ {
+ Console.WriteLine("ExportedAuditlogs Criteria Group Operator: " + criteria.GroupOperator);
+ }
+ }
+
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL").Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ long Id = 0;
+ GetExportedAuditlog_1(Id);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
+
diff --git a/versions/3.0.0/Samples/AuditLogExport1/GetExportedAuditlogs.cs b/versions/3.0.0/Samples/AuditLogExport1/GetExportedAuditlogs.cs
new file mode 100644
index 0000000..b6c6704
--- /dev/null
+++ b/versions/3.0.0/Samples/AuditLogExport1/GetExportedAuditlogs.cs
@@ -0,0 +1,140 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using Com.Zoho.API.Authenticator;
+using Com.Zoho.Crm.API.AuditLogExport;
+using Com.Zoho.Crm.API.Dc;
+using Com.Zoho.Crm.API.Util;
+using Newtonsoft.Json;
+
+namespace Samples.AuditLogExport1
+{
+ public class GetExportedAuditlogs
+ {
+ public static void GetExportedAuditlogs_1()
+ {
+ AuditLogExportOperations auditLogExportOperations = new AuditLogExportOperations();
+ APIResponse response = auditLogExportOperations.GetExportedAuditlogs();
+ if (response != null)
+ {
+ Console.WriteLine("Status Code: " + response.StatusCode);
+ if (response.IsExpected)
+ {
+ ResponseHandler actionHandler = response.Object;
+ if (actionHandler is ResponseWrapper)
+ {
+ ResponseWrapper responseWrapper = (ResponseWrapper)actionHandler;
+ List auditLogExport = responseWrapper.AuditLogExport;
+ if (auditLogExport != null)
+ {
+ foreach (AuditLogExport auditLogExport1 in auditLogExport)
+ {
+ Criteria criteria = auditLogExport1.Criteria;
+ if (criteria != null)
+ {
+ PrintCriteria(criteria);
+ }
+ Console.WriteLine("AuditLogExport Id : " + auditLogExport1.Id);
+ Console.WriteLine("AuditLogExport Status : " + auditLogExport1.Status);
+ User createdBy = auditLogExport1.CreatedBy;
+ if(createdBy != null)
+ {
+ Console.WriteLine("AuditLogExport User Id : " + createdBy.Id);
+ Console.WriteLine("AuditLogExport User Id : " + createdBy.Name);
+ }
+ List downloadLinks = auditLogExport1.DownloadLinks;
+ if(downloadLinks != null)
+ {
+ foreach (String link in downloadLinks)
+ {
+ Console.WriteLine("AuditLogExport DownloadLink : " + link);
+ }
+ }
+ Console.WriteLine("AuditLogExport JobStartTime : " + auditLogExport1.JobStartTime);
+ Console.WriteLine("AuditLogExport JobEndTime : " + auditLogExport1.JobEndTime);
+ Console.WriteLine("AuditLogExport ExpiryDate : " + auditLogExport1.ExpiryDate);
+ }
+ }
+ }
+ else if (actionHandler is APIException)
+ {
+ APIException exception = (APIException)actionHandler;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ System.Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+
+ private static void PrintCriteria(Criteria criteria)
+ {
+ if (criteria.Comparator != null)
+ {
+ Console.WriteLine("ExportedAuditlogs Criteria Comparator: " + criteria.Comparator);
+ }
+ if (criteria.Value != null)
+ {
+ Console.WriteLine("ExportedAuditlogs Criteria Value: " + criteria.Value);
+ }
+ if (criteria.Field != null)
+ {
+ Console.WriteLine("ExportedAuditlogs Criteria field name: " + criteria.Field.APIName);
+ }
+ List criteriaGroup = criteria.Group;
+ if (criteriaGroup != null)
+ {
+ foreach (Criteria criteria1 in criteriaGroup)
+ {
+ PrintCriteria(criteria1);
+ }
+ }
+ if (criteria.GroupOperator != null)
+ {
+ Console.WriteLine("ExportedAuditlogs Criteria Group Operator: " + criteria.GroupOperator);
+ }
+ }
+
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL").Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ GetExportedAuditlogs_1();
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
+
diff --git a/versions/3.0.0/Samples/Blueprint/GetBlueprint.cs b/versions/3.0.0/Samples/Blueprint/GetBlueprint.cs
new file mode 100644
index 0000000..5bd8a57
--- /dev/null
+++ b/versions/3.0.0/Samples/Blueprint/GetBlueprint.cs
@@ -0,0 +1,398 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using Com.Zoho.API.Authenticator;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using APIException = Com.Zoho.Crm.API.Blueprint.APIException;
+using BlueprintOperations = Com.Zoho.Crm.API.Blueprint.BlueprintOperations;
+using Currency = Com.Zoho.Crm.API.Blueprint.Currency;
+using Escalation = Com.Zoho.Crm.API.Blueprint.Escalation;
+using Field = Com.Zoho.Crm.API.Blueprint.Field;
+using Layout = Com.Zoho.Crm.API.Blueprint.Layout;
+using NextTransition = Com.Zoho.Crm.API.Blueprint.NextTransition;
+using ProcessInfo = Com.Zoho.Crm.API.Blueprint.ProcessInfo;
+using ResponseHandler = Com.Zoho.Crm.API.Blueprint.ResponseHandler;
+using ResponseWrapper = Com.Zoho.Crm.API.Blueprint.ResponseWrapper;
+using Transition = Com.Zoho.Crm.API.Blueprint.Transition;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using External = Com.Zoho.Crm.API.Fields.External;
+using Maps = Com.Zoho.Crm.API.Fields.Maps;
+using Module = Com.Zoho.Crm.API.Blueprint.Module;
+using MultiModuleLookup = Com.Zoho.Crm.API.Fields.MultiModuleLookup;
+using PickListValue = Com.Zoho.Crm.API.Fields.PickListValue;
+using MultiSelectLookup = Com.Zoho.Crm.API.Blueprint.MultiSelectLookup;
+using ToolTip = Com.Zoho.Crm.API.Blueprint.ToolTip;
+using Unique = Com.Zoho.Crm.API.Fields.Unique;
+using ViewType = Com.Zoho.Crm.API.Blueprint.ViewType;
+using Record = Com.Zoho.Crm.API.Record.Record;
+using MinifiedUser = Com.Zoho.Crm.API.Users.MinifiedUser;
+using Com.Zoho.Crm.API.Util;
+using Com.Zoho.Crm.API.Dc;
+using Newtonsoft.Json;
+
+
+namespace Samples.Blueprint
+{
+ public class GetBlueprint
+ {
+ public static void GetBlueprint_1(string moduleAPIName, string recordId)
+ {
+ BlueprintOperations bluePrintOperations = new BlueprintOperations(recordId, moduleAPIName);
+ APIResponse response = bluePrintOperations.GetBlueprint();
+ if (response != null)
+ {
+ Console.WriteLine("Status Code: " + response.StatusCode);
+ if (new List() { 204, 304 }.Contains(response.StatusCode))
+ {
+ Console.WriteLine(response.StatusCode == 204 ? "No Content" : "Not Modified");
+ return;
+ }
+ if (response.IsExpected)
+ {
+ ResponseHandler responseHandler = response.Object;
+ if (responseHandler is ResponseWrapper)
+ {
+ ResponseWrapper responseWrapper = (ResponseWrapper)responseHandler;
+ Com.Zoho.Crm.API.Blueprint.BluePrint bluePrint = responseWrapper.Blueprint;
+ ProcessInfo processInfo = bluePrint.ProcessInfo;
+ if (processInfo != null)
+ {
+ Console.WriteLine("ProcessInfo Field-ID: " + processInfo.FieldId);
+ Escalation escalation = processInfo.Escalation;
+ if (escalation != null)
+ {
+ Console.WriteLine("Escalation days: " + escalation.Days);
+ Console.WriteLine("Escalation status: " + escalation.Status);
+ }
+ Console.WriteLine("ProcessInfo isContinuous: " + processInfo.IsContinuous);
+ Console.WriteLine("ProcessInfo API Name: " + processInfo.APIName);
+ Console.WriteLine("ProcessInfo Continuous: " + processInfo.Continuous);
+ Console.WriteLine("ProcessInfo FieldLabel: " + processInfo.FieldLabel);
+ Console.WriteLine("ProcessInfo Name: " + processInfo.Name);
+ Console.WriteLine("ProcessInfo ColumnName: " + processInfo.ColumnName);
+ Console.WriteLine("ProcessInfo FieldValue: " + processInfo.FieldValue);
+ Console.WriteLine("ProcessInfo ID: " + processInfo.Id);
+ Console.WriteLine("ProcessInfo FieldName: " + processInfo.FieldName);
+ }
+ List transitions = bluePrint.Transitions;
+ foreach (Transition transition in transitions)
+ {
+ List nextTransitions = transition.NextTransitions;
+ foreach (NextTransition nextTransition in nextTransitions)
+ {
+ Console.WriteLine("NextTransition ID: " + nextTransition.Id);
+ Console.WriteLine("NextTransition criteria_matched: " + nextTransition.CriteriaMatched);
+ Console.WriteLine("NextTransition Name: " + nextTransition.Name);
+ Console.WriteLine("NextTransition type: " + nextTransition.Type);
+ }
+ Transition parentTransition = transition.ParentTransition;
+ if (parentTransition != null)
+ {
+ Console.WriteLine("Parenttransition ID: " + parentTransition.Id);
+ }
+ Com.Zoho.Crm.API.Record.Record data = transition.Data;
+ Console.WriteLine("Record ID: " + data.Id);
+ MinifiedUser createdBy = data.CreatedBy;
+ if (createdBy != null)
+ {
+ Console.WriteLine("Record Created By User-ID: " + createdBy.Id);
+ Console.WriteLine("Record Created By User-Name: " + createdBy.Name);
+ }
+ if (data.CreatedTime != null)
+ {
+ Console.WriteLine("Record Created Time: " + data.CreatedTime);
+ }
+ if (data.ModifiedTime != null)
+ {
+ Console.WriteLine("Record Modified Time: " + data.ModifiedTime);
+ }
+ MinifiedUser modifiedBy = data.ModifiedBy;
+ if (modifiedBy != null)
+ {
+ Console.WriteLine("Record Modified By User-ID: " + modifiedBy.Id);
+ Console.WriteLine("Record Modified By user-Name: " + modifiedBy.Name);
+ }
+ foreach (KeyValuePair entry in data.GetKeyValues())
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Transition NextFieldValue: " + transition.NextFieldValue);
+ Console.WriteLine("Transition Name: " + transition.Name);
+ Console.WriteLine("Transition CriteriaMatched: " + transition.CriteriaMatched);
+ Console.WriteLine("Transition ID: " + transition.Id);
+ Console.WriteLine("Transition Fields: ");
+ List fields = transition.Fields;
+ foreach (Field fieldHandler in fields)
+ {
+ Field field = (Field)fieldHandler;
+ if (field.SystemMandatory != null)
+ {
+ Console.WriteLine("Field is SystemMandatory: " + field.SystemMandatory);
+ }
+ Console.WriteLine("Field is Private" + field.Private);
+ Console.WriteLine("Transition Fields Webhook: " + field.Webhook);
+ Console.WriteLine("Transition Fields JsonType: " + field.JsonType);
+ Console.WriteLine("Transition Fields DisplayLabel: " + field.DisplayLabel);
+ Console.WriteLine("Transition Fields UiType: " + field.UiType);
+ Console.WriteLine("Transition Fields ValidationRule: " + field.ValidationRule);
+ Console.WriteLine("Transition Fields DataType: " + field.DataType);
+ Console.WriteLine("Transition Fields Type: " + field.Type);
+ Console.WriteLine("Transition Fields ColumnName: " + field.ColumnName);
+ Console.WriteLine("Transition Fields PersonalityName: " + field.PersonalityName);
+ Console.WriteLine("Transition Fields ID: " + field.Id);
+ Console.WriteLine("Transition Fields TransitionSequence: " + field.TransitionSequence);
+ if (field.Mandatory != null)
+ {
+ Console.WriteLine("Transition Fields Mandatory: " + field.Mandatory);
+ }
+ Layout layout = field.Layouts;
+ if (layout != null)
+ {
+ Console.WriteLine("Transition Fields Layout ID: " + layout.Id);
+ Console.WriteLine("Transition Fields Layout Name: " + layout.Name);
+ }
+ Console.WriteLine("Field PickListValuesSortedLexically: " + field.PickListValuesSortedLexically);
+ Console.WriteLine("Field Sortable: " + field.Sortable);
+ Console.WriteLine("Field TransitionSequence: " + field.TransitionSequence);
+ External external = field.External;
+ if (external != null)
+ {
+ Console.WriteLine("Field External Show: " + external.Show);
+ Console.WriteLine("Field External Type: " + external.Type);
+ Console.WriteLine("Field External AllowMultipleConfig: " + external.AllowMultipleConfig);
+ }
+ Unique unique = field.Unique;
+ if (unique != null)
+ {
+ Console.WriteLine("Field Unique Casesensitive : " + unique.Casesensitive);
+ }
+ if (field.HistoryTracking != null)
+ {
+ Console.WriteLine("Field HistoryTracking: " + field.HistoryTracking);
+ }
+ Console.WriteLine("Field DataType: " + field.DataType);
+ Console.WriteLine("Transition Fields APIName: " + field.APIName);
+ Console.WriteLine("Transition Fields Content: " + field.Content);
+ if (field.SystemMandatory != null)
+ {
+ Console.WriteLine("Transition Fields SystemMandatory: " + field.SystemMandatory);
+ }
+ Console.WriteLine("Transition Fields FieldLabel: " + field.FieldLabel);
+ MultiModuleLookup multiModuleLookup = field.MultiModuleLookup;
+ if (multiModuleLookup != null)
+ {
+ Console.WriteLine("Field MultiModuleLookup APIName: " + multiModuleLookup.APIName);
+ Console.WriteLine("Field MultiModuleLookup DisplayLabel: " + multiModuleLookup.DisplayLabel);
+ if(multiModuleLookup.Modules != null)
+ {
+ foreach (Com.Zoho.Crm.API.Modules.MinifiedModule module in multiModuleLookup.Modules)
+ {
+ Console.WriteLine("Field MultiModuleLookup Module ID: " + module.Id);
+ Console.WriteLine("Field MultiModuleLookup Module APIName: " + module.APIName);
+ }
+ }
+ }
+ Currency currency = field.Currency;
+ if (currency != null)
+ {
+ Console.WriteLine("Field Currency RoundingOption: " + currency.RoundingOption);
+ if (currency.Precision != null)
+ {
+ Console.WriteLine("Field Currency Precision: " + currency.Precision);
+ }
+ }
+ ToolTip toolTip = field.Tooltip;
+ if (toolTip != null)
+ {
+ Console.WriteLine("Transition Fields Tooltip Name: " + toolTip.Name);
+ Console.WriteLine("Transition Fields Tooltip Value: " + toolTip.Value);
+ }
+ Console.WriteLine("Transition Fields CreatedSource: " + field.CreatedSource);
+ if (field.FieldReadOnly != null)
+ {
+ Console.WriteLine("Transition Fields FieldReadOnly: " + field.FieldReadOnly);
+ }
+ if (field.DisplayType != null)
+ {
+ Console.WriteLine("Transition Fields DisplayType: " + field.DisplayType);
+ }
+ if (field.ReadOnly != null)
+ {
+ Console.WriteLine("Transition Fields ReadOnly: " + field.ReadOnly);
+ }
+ Console.WriteLine("Transition Fields AssociationDetails: " + field.AssociationDetails);
+ if (field.QuickSequenceNumber != null)
+ {
+ Console.WriteLine("Transition Fields QuickSequenceNumber: " + field.QuickSequenceNumber);
+ }
+ if (field.CustomField != null)
+ {
+ Console.WriteLine("Transition Fields CustomField: " + field.CustomField);
+ }
+ Module lookup = field.Lookup;
+ if (lookup != null)
+ {
+ Console.WriteLine("Field ModuleLookup DisplayLabel: " + lookup.DisplayLabel);
+ Console.WriteLine("Field ModuleLookup APIName: " + lookup.APIName);
+ Console.WriteLine("Field ModuleLookup Module: " + lookup.Module_1);
+ if (lookup.Id != null)
+ {
+ Console.WriteLine("Field ModuleLookup ID: " + lookup.Id);
+ }
+ }
+ Console.WriteLine("Field Filterable: " + field.Filterable);
+ if (field.Visible != null)
+ {
+ Console.WriteLine("Transition Fields Visible: " + field.Visible);
+ }
+ List profiles = field.Profiles;
+ if (profiles != null)
+ {
+ foreach (Com.Zoho.Crm.API.Blueprint.Profile profile in profiles)
+ {
+ Console.WriteLine("Field Profile PermissionType: " + profile.PermissionType);
+ Console.WriteLine("Field Profile Name: " + profile.Name);
+ Console.WriteLine("Field Profile Id: " + profile.Id);
+ }
+ }
+ if (field.Formula != null)
+ {
+ if (field.Formula.Expression != null)
+ {
+ Console.WriteLine("Field Formula Expression : " + field.Formula.Expression);
+ }
+ }
+ if (field.DecimalPlace != null)
+ {
+ Console.WriteLine("Field DecimalPlace: " + field.DecimalPlace);
+ }
+ if (field.Length != null)
+ {
+ Console.WriteLine("Transition Fields Length: " + field.Length);
+ }
+ Console.WriteLine("Transition Fields DecimalPlace: " + field.DecimalPlace);
+ ViewType viewType = field.ViewType;
+ if (viewType != null)
+ {
+ Console.WriteLine("Transition Fields ViewType View: " + viewType.View);
+ Console.WriteLine("Transition Fields ViewType Edit: " + viewType.Edit);
+ Console.WriteLine("Transition Fields ViewType Create: " + viewType.Create);
+ Console.WriteLine("Transition Fields ViewType QuickCreate: " + viewType.QuickCreate);
+ }
+ List pickListValues = field.PickListValues;
+ if (pickListValues != null)
+ {
+ foreach (PickListValue pickListValue in pickListValues)
+ {
+ PrintPickListValue(pickListValue);
+ }
+ }
+ MultiSelectLookup multiSelectLookup = field.Multiselectlookup;
+ if (multiSelectLookup != null)
+ {
+ Console.WriteLine("Transition Fields MultiSelectLookup DisplayLabel: " + multiSelectLookup.DisplayLabel);
+ Console.WriteLine("Transition Fields MultiSelectLookup LinkingModule: " + multiSelectLookup.LinkingModule);
+ Console.WriteLine("Transition Fields MultiSelectLookup LookupApiname: " + multiSelectLookup.LookupApiname);
+ Console.WriteLine("Transition Fields MultiSelectLookup APIName: " + multiSelectLookup.APIName);
+ Console.WriteLine("Transition Fields MultiSelectLookup ConnectedlookupApiname: " + multiSelectLookup.ConnectedlookupApiname);
+ Console.WriteLine("Transition Fields MultiSelectLookup ID: " + multiSelectLookup.Id);
+ }
+ Com.Zoho.Crm.API.Blueprint.AutoNumber autoNumber = field.AutoNumber;
+ if (autoNumber != null)
+ {
+ Console.WriteLine("Transition Fields AutoNumber Prefix: " + autoNumber.Prefix);
+ Console.WriteLine("Transition Fields AutoNumber Suffix: " + autoNumber.Suffix);
+ if (autoNumber.StartNumber != null)
+ {
+ Console.WriteLine("Transition Fields Auto StartNumber: " + autoNumber.StartNumber);
+ }
+ }
+ Console.WriteLine("Transition Fields ConvertMapping: ");
+ if (field.ConvertMapping != null)
+ {
+ foreach (KeyValuePair entry in field.ConvertMapping)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ }
+ }
+ Console.WriteLine("Transition CriteriaMessage: " + transition.CriteriaMessage);
+ Console.WriteLine("Transition PercentPartialSave: " + transition.PercentPartialSave);
+ Console.WriteLine("Transition ExecutionTime: " + transition.ExecutionTime);
+ Console.WriteLine("Transition Type: " + transition.Type);
+ }
+ }
+ else if (responseHandler is APIException)
+ {
+ APIException exception = (APIException)responseHandler;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message.Value);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+ public static void PrintPickListValue(PickListValue pickListValue)
+ {
+ Console.WriteLine(" Fields PickListValue DisplayValue: " + pickListValue.DisplayValue);
+ Console.WriteLine(" Fields PickListValue SequenceNumber: " + pickListValue.SequenceNumber);
+ Console.WriteLine(" Fields PickListValue ExpectedDataType: " + pickListValue.ExpectedDataType);
+ Console.WriteLine(" Fields PickListValue ActualValue: " + pickListValue.ActualValue);
+ Console.WriteLine(" Fields PickListValue SysRefName: " + pickListValue.SysRefName);
+ Console.WriteLine(" Fields PickListValue Type: " + pickListValue.Type);
+ Console.WriteLine(" Fields PickListValue Id: " + pickListValue.Id);
+ foreach (Maps map in pickListValue.Maps)
+ {
+ Console.WriteLine(map);
+ List pickListValues = map.PickListValues;
+ if (pickListValues != null)
+ {
+ foreach (PickListValue plv in pickListValues)
+ {
+ PrintPickListValue(plv);
+ }
+ }
+ }
+ }
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL").Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ string moduleAPIName = "Leads";
+ string recordId = "3473121042";
+ GetBlueprint_1(moduleAPIName, recordId);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/versions/3.0.0/Samples/Blueprint/UpdateBlueprint.cs b/versions/3.0.0/Samples/Blueprint/UpdateBlueprint.cs
new file mode 100644
index 0000000..6ff9dc6
--- /dev/null
+++ b/versions/3.0.0/Samples/Blueprint/UpdateBlueprint.cs
@@ -0,0 +1,174 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using Com.Zoho.API.Authenticator;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using APIException = Com.Zoho.Crm.API.Blueprint.APIException;
+using ActionHandler = Com.Zoho.Crm.API.Blueprint.ActionHandler;
+using BlueprintOperations = Com.Zoho.Crm.API.Blueprint.BlueprintOperations;
+using BodyWrapper = Com.Zoho.Crm.API.Blueprint.BodyWrapper;
+using Escalation = Com.Zoho.Crm.API.Blueprint.Escalation;
+using NextTransition = Com.Zoho.Crm.API.Blueprint.NextTransition;
+using ProcessInfo = Com.Zoho.Crm.API.Blueprint.ProcessInfo;
+using SuccessResponse = Com.Zoho.Crm.API.Blueprint.SuccessResponse;
+using Transition = Com.Zoho.Crm.API.Blueprint.Transition;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using Com.Zoho.Crm.API.Util;
+using Com.Zoho.Crm.API.Dc;
+using Newtonsoft.Json;
+
+
+namespace Samples.Blueprint
+{
+ public class UpdateBlueprint
+ {
+ public static void UpdateBlueprint_1(string moduleAPIName, string recordId, string transitionId)
+ {
+ BlueprintOperations bluePrintOperations = new BlueprintOperations(recordId, moduleAPIName);
+ BodyWrapper bodyWrapper = new BodyWrapper();
+ List bluePrintList = new List();
+ Com.Zoho.Crm.API.Blueprint.BluePrint bluePrint = new Com.Zoho.Crm.API.Blueprint.BluePrint();
+ bluePrint.TransitionId = transitionId;
+ Com.Zoho.Crm.API.Record.Record data = new Com.Zoho.Crm.API.Record.Record();
+ Dictionary lookup = new Dictionary();
+ lookup.Add("Phone", "8972937");
+ lookup.Add("id", "8972937");
+ data.AddKeyValue("Phone", "892937");
+ data.AddKeyValue("Notes", "Updated via blueprint");
+ Dictionary attachments = new Dictionary();
+ List fileIds = new List();
+ fileIds.Add("blojtd2d13b5f044e4041a3315793fb21ef");
+ attachments.Add("file_id", fileIds);
+ attachments.Add("link_url", "ww.zoho.com");
+ // data.AddKeyValue("Attachments", attachments);
+ List> listings = new List>();
+ Dictionary interested_listings = new Dictionary();
+ interested_listings.Add("id", 36521978005L);
+ listings.Add(interested_listings);
+ // data.AddKeyValue("Listings", listings);
+ List> multiuser = new List>();
+ Dictionary multi_user = new Dictionary();
+ multi_user.Add("name", "givenname");
+ multi_user.Add("id", 36527186017L);
+ multiuser.Add(multi_user);
+ // data.AddKeyValue("Multi_user", multiuser);
+ ProcessInfo processinfo = new ProcessInfo();
+ processinfo.APIName = "apiname";
+ processinfo.ColumnName = "columnname";
+ processinfo.Continuous = false;
+ processinfo.FieldId = 323243l;
+ processinfo.FieldLabel = "fieldlabel";
+ processinfo.FieldName = "field_name";
+ processinfo.Id = "32900132223";
+ processinfo.IsContinuous = false;
+ processinfo.Name = "name";
+ Escalation escalation = new Escalation();
+ escalation.Days = 1;
+ escalation.Status = "overdue";
+ processinfo.Escalation = escalation;
+ // bluePrint.ProcessInfo = processinfo;
+ List transitions = new List();
+ Transition transition = new Transition();
+ transition.Type = "manual";
+ List nextTransitions = new List();
+ NextTransition nexttransition = new NextTransition();
+ nexttransition.Id = "36523973921103";
+ nexttransition.Name = "call later";
+ nexttransition.Type = "manual";
+ nexttransition.CriteriaMatched = false;
+ nextTransitions.Add(nexttransition);
+ transition.NextTransitions = nextTransitions;
+ transitions.Add(transition);
+ // bluePrint.Transitions = transitions;
+ List> checkLists = new List>();
+ Dictionary checkListItem = new Dictionary();
+ checkListItem.Add("list 1", true);
+ checkLists.Add(checkListItem);
+ checkListItem = new Dictionary();
+ checkListItem.Add("list 2", true);
+ checkLists.Add(checkListItem);
+ checkListItem = new Dictionary();
+ checkListItem.Add("list 3", true);
+ checkLists.Add(checkListItem);
+ // data.AddKeyValue("CheckLists", checkLists);
+ Dictionary tasks = new Dictionary();
+ tasks.Add("Subject", "Event");
+ // data.AddKeyValue("Tasks", tasks);
+ bluePrint.Data = data;
+ bluePrintList.Add(bluePrint);
+ bodyWrapper.Blueprint = bluePrintList;
+ APIResponse response = bluePrintOperations.UpdateBlueprint(bodyWrapper);
+ if (response != null)
+ {
+ Console.WriteLine("Status Code: " + response.StatusCode);
+ if (response.IsExpected)
+ {
+ ActionHandler actionResponse = response.Object;
+ if (actionResponse is SuccessResponse)
+ {
+ SuccessResponse successResponse = (SuccessResponse)actionResponse;
+ Console.WriteLine("Status: " + successResponse.Status.Value);
+ Console.WriteLine("Code: " + successResponse.Code.Value);
+ Console.WriteLine("Details: ");
+ if (successResponse.Details != null)
+ {
+ foreach (KeyValuePair entry in successResponse.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ }
+ Console.WriteLine("Message: " + successResponse.Message.Value);
+ }
+ else if (actionResponse is APIException)
+ {
+ APIException exception = (APIException)actionResponse;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL").Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ string moduleAPIName = "Leads";
+ string recordId = "34770611002";
+ string transitionId = "343122189321";
+ UpdateBlueprint_1(moduleAPIName, recordId, transitionId);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/versions/3.0.0/Samples/CadencesExecution/EnrolCadences.cs b/versions/3.0.0/Samples/CadencesExecution/EnrolCadences.cs
new file mode 100644
index 0000000..a596fe1
--- /dev/null
+++ b/versions/3.0.0/Samples/CadencesExecution/EnrolCadences.cs
@@ -0,0 +1,117 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using Com.Zoho.API.Authenticator;
+using Com.Zoho.Crm.API.CadencesExecution;
+using Com.Zoho.Crm.API.Dc;
+using Com.Zoho.Crm.API.Util;
+using Newtonsoft.Json;
+
+namespace Samples.CadencesExecution
+{
+ public class EnrolCadences
+ {
+ public static void EnrolCadences_1(string ModuleAPIName)
+ {
+ CadencesExecutionOperations cadencesExecutionOperations = new CadencesExecutionOperations();
+ BodyWrapper request = new BodyWrapper();
+ List cadencesIds = new List();
+ cadencesIds.Add("3475001");
+ request.CadencesIds = cadencesIds;
+ List ids = new List();
+ ids.Add("34774115001");
+ request.Ids = ids;
+ APIResponse response = cadencesExecutionOperations.EnrolCadences(ModuleAPIName, request);
+ if (response != null)
+ {
+ Console.WriteLine("Status Code: " + response.StatusCode);
+ if (response.IsExpected)
+ {
+ ActionHandler actionHandler = response.Object;
+ if (actionHandler is ActionWrapper)
+ {
+ ActionWrapper actionWrapper = (ActionWrapper)actionHandler;
+ List actionresponses = actionWrapper.Data;
+ foreach (ActionResponse actionresponse in actionresponses)
+ {
+ if (actionresponse is SuccessResponse)
+ {
+ SuccessResponse successresponse = (SuccessResponse)actionresponse;
+ Console.WriteLine("Status: " + successresponse.Status.Value);
+ Console.WriteLine("Code: " + successresponse.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in successresponse.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + successresponse.Message);
+ }
+ else if (actionresponse is APIException)
+ {
+ APIException exception = (APIException)actionresponse;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message);
+ }
+ }
+
+ }
+ else if (actionHandler is APIException)
+ {
+ APIException exception = (APIException)actionHandler;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ System.Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL").Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ string ModuleAPIName = "Leads";
+ EnrolCadences_1(ModuleAPIName);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
diff --git a/versions/3.0.0/Samples/CadencesExecution/UnenrolCadences.cs b/versions/3.0.0/Samples/CadencesExecution/UnenrolCadences.cs
new file mode 100644
index 0000000..f39e856
--- /dev/null
+++ b/versions/3.0.0/Samples/CadencesExecution/UnenrolCadences.cs
@@ -0,0 +1,117 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using Com.Zoho.API.Authenticator;
+using Com.Zoho.Crm.API.CadencesExecution;
+using Com.Zoho.Crm.API.Dc;
+using Com.Zoho.Crm.API.Util;
+using Newtonsoft.Json;
+
+namespace Samples.CadencesExecution
+{
+ public class UnenrolCadences
+ {
+ public static void UnenrolCadences_1(string ModuleAPIName)
+ {
+ CadencesExecutionOperations cadencesExecutionOperations = new CadencesExecutionOperations();
+ BodyWrapper request = new BodyWrapper();
+ List cadencesIds = new List();
+ cadencesIds.Add("3477085001");
+ request.CadencesIds = cadencesIds;
+ List ids = new List();
+ ids.Add("3477065001");
+ request.Ids = ids;
+ APIResponse response = cadencesExecutionOperations.UnenrolCadences(ModuleAPIName, request);
+ if (response != null)
+ {
+ Console.WriteLine("Status Code: " + response.StatusCode);
+ if (response.IsExpected)
+ {
+ ActionHandler actionHandler = response.Object;
+ if (actionHandler is ActionWrapper)
+ {
+ ActionWrapper actionWrapper = (ActionWrapper)actionHandler;
+ List actionresponses = actionWrapper.Data;
+ foreach (ActionResponse actionresponse in actionresponses)
+ {
+ if (actionresponse is SuccessResponse)
+ {
+ SuccessResponse successresponse = (SuccessResponse)actionresponse;
+ Console.WriteLine("Status: " + successresponse.Status.Value);
+ Console.WriteLine("Code: " + successresponse.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in successresponse.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + successresponse.Message);
+ }
+ else if (actionresponse is APIException)
+ {
+ APIException exception = (APIException)actionresponse;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message);
+ }
+ }
+
+ }
+ else if (actionHandler is APIException)
+ {
+ APIException exception = (APIException)actionHandler;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ System.Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL").Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ string ModuleAPIName = "Leads";
+ UnenrolCadences_1(ModuleAPIName);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
diff --git a/versions/3.0.0/Samples/DuplicateCheckPreference1/CreateDuplicateCheckPreference.cs b/versions/3.0.0/Samples/DuplicateCheckPreference1/CreateDuplicateCheckPreference.cs
new file mode 100644
index 0000000..eb018b2
--- /dev/null
+++ b/versions/3.0.0/Samples/DuplicateCheckPreference1/CreateDuplicateCheckPreference.cs
@@ -0,0 +1,134 @@
+using System;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using Com.Zoho.Crm.API.DuplicateCheckPreference;
+using Com.Zoho.Crm.API.Util;
+using System.Collections.Generic;
+using System.Reflection;
+using Newtonsoft.Json;
+using Com.Zoho.Crm.API.Dc;
+using Com.Zoho.API.Authenticator;
+
+namespace Samples.DuplicateCheckPreference1
+{
+ public class CreateDuplicateCheckPreference
+ {
+ public static void CreateDuplicateCheckPreference_1(string moduleAPIName)
+ {
+ DuplicateCheckPreferenceOperations duplicateCheckPreferenceOperations = new DuplicateCheckPreferenceOperations(moduleAPIName);
+ BodyWrapper request = new BodyWrapper();
+ DuplicateCheckPreference duplicateCheckPreference = new DuplicateCheckPreference();
+ duplicateCheckPreference.Type = new Choice("mapped_module_records");
+
+ List typeConfigurations = new List();
+ TypeConfiguration typeConfiguration = new TypeConfiguration();
+ MappedModule mappedModule = new MappedModule();
+ mappedModule.Id = "34770612175";
+ mappedModule.APIName = "Leads";
+ typeConfiguration.MappedModule = mappedModule;
+ List fieldMappings = new List();
+ FieldMappings fieldMapping = new FieldMappings();
+ CurrentField currentField = new CurrentField();
+ currentField.Id = "34770616570001";
+ currentField.APIName = "Email_1";
+ fieldMapping.CurrentField = currentField;
+
+ MappedField mappedField = new MappedField();
+ mappedField.Id = "347706123537018";
+ mappedField.APIName = "Email_2";
+ fieldMapping.MappedField = mappedField;
+
+ fieldMappings.Add(fieldMapping);
+ typeConfiguration.FieldMappings = fieldMappings;
+ typeConfigurations.Add(typeConfiguration);
+ duplicateCheckPreference.TypeConfigurations = typeConfigurations;
+ request.DuplicateCheckPreference = duplicateCheckPreference;
+ APIResponse response = duplicateCheckPreferenceOperations.CreateDuplicateCheckPreference(request);
+ if (response != null)
+ {
+ Console.WriteLine("Status Code: " + response.StatusCode);
+ if (response.IsExpected)
+ {
+ ActionHandler actionHandler = response.Object;
+ if (actionHandler is ActionWrapper)
+ {
+ ActionWrapper actionWrapper = (ActionWrapper) actionHandler;
+ ActionResponse actionresponse = actionWrapper.DuplicateCheckPreference;
+ if (actionresponse is SuccessResponse)
+ {
+ SuccessResponse successresponse = (SuccessResponse) actionresponse;
+ Console.WriteLine("Status: " + successresponse.Status.Value);
+ Console.WriteLine("Code: " + successresponse.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in successresponse.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + successresponse.Message);
+ }
+ else if (actionresponse is APIException)
+ {
+ APIException exception = (APIException) actionresponse;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message.Value);
+ }
+ }
+ else if (actionHandler is APIException)
+ {
+ APIException exception = (APIException) actionHandler;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message.Value);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL" ).Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ string moduleAPIName = "Contacts";
+ CreateDuplicateCheckPreference_1(moduleAPIName);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
+
diff --git a/versions/3.0.0/Samples/DuplicateCheckPreference1/DeleteDuplicateCheckPreference.cs b/versions/3.0.0/Samples/DuplicateCheckPreference1/DeleteDuplicateCheckPreference.cs
new file mode 100644
index 0000000..e397ea6
--- /dev/null
+++ b/versions/3.0.0/Samples/DuplicateCheckPreference1/DeleteDuplicateCheckPreference.cs
@@ -0,0 +1,107 @@
+using System;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using Com.Zoho.Crm.API.DuplicateCheckPreference;
+using Com.Zoho.Crm.API.Util;
+using System.Collections.Generic;
+using System.Reflection;
+using Newtonsoft.Json;
+using Com.Zoho.Crm.API.Dc;
+using Com.Zoho.API.Authenticator;
+
+namespace Samples.DuplicateCheckPreference1
+{
+ public class DeleteDuplicateCheckPreference
+ {
+ public static void DeleteDuplicateCheckPreference_1(string moduleAPIName)
+ {
+ DuplicateCheckPreferenceOperations duplicateCheckPreferenceOperations = new DuplicateCheckPreferenceOperations(moduleAPIName);
+ APIResponse response = duplicateCheckPreferenceOperations.DeleteDuplicateCheckPreference();
+ if (response != null)
+ {
+ Console.WriteLine("Status Code: " + response.StatusCode);
+ if (response.IsExpected)
+ {
+ ActionHandler actionHandler = response.Object;
+ if (actionHandler is ActionWrapper)
+ {
+ ActionWrapper actionWrapper = (ActionWrapper)actionHandler;
+ ActionResponse actionresponse = actionWrapper.DuplicateCheckPreference;
+ if (actionresponse is SuccessResponse)
+ {
+ SuccessResponse successresponse = (SuccessResponse)actionresponse;
+ Console.WriteLine("Status: " + successresponse.Status.Value);
+ Console.WriteLine("Code: " + successresponse.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in successresponse.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + successresponse.Message);
+ }
+ else if (actionresponse is APIException)
+ {
+ APIException exception = (APIException)actionresponse;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message.Value);
+ }
+ }
+ else if (actionHandler is APIException)
+ {
+ APIException exception = (APIException)actionHandler;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message.Value);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL").Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ string moduleAPIName = "Contacts";
+ DeleteDuplicateCheckPreference_1(moduleAPIName);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
+
diff --git a/versions/3.0.0/Samples/DuplicateCheckPreference1/GetDuplicateCheckPreference.cs b/versions/3.0.0/Samples/DuplicateCheckPreference1/GetDuplicateCheckPreference.cs
new file mode 100644
index 0000000..56aa6d5
--- /dev/null
+++ b/versions/3.0.0/Samples/DuplicateCheckPreference1/GetDuplicateCheckPreference.cs
@@ -0,0 +1,124 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using Com.Zoho.API.Authenticator;
+using Com.Zoho.Crm.API;
+using Com.Zoho.Crm.API.Dc;
+using Com.Zoho.Crm.API.DuplicateCheckPreference;
+using Com.Zoho.Crm.API.Util;
+using Newtonsoft.Json;
+
+namespace Samples.DuplicateCheckPreference1
+{
+ public class GetDuplicateCheckPreference
+ {
+ public static void GetDuplicateCheckPreference_1(string moduleAPIName)
+ {
+ DuplicateCheckPreferenceOperations duplicateCheckPreferenceOperations = new DuplicateCheckPreferenceOperations(moduleAPIName);
+ APIResponse response = duplicateCheckPreferenceOperations.GetDuplicateCheckPreference();
+ if (response != null)
+ {
+ Console.WriteLine("Status Code: " + response.StatusCode);
+ if (response.StatusCode == 204)
+ {
+ Console.WriteLine("No Content");
+ return;
+ }
+ if (response.IsExpected)
+ {
+ ResponseHandler responseHandler = response.Object;
+ if (responseHandler is ResponseWrapper)
+ {
+ ResponseWrapper responseWrapper = (ResponseWrapper)responseHandler;
+ DuplicateCheckPreference duplicateCheckPreference = responseWrapper.DuplicateCheckPreference;
+ Console.WriteLine("DuplicateCheckPreference Type : " + duplicateCheckPreference.Type.Value);
+ List typeConfigurations = duplicateCheckPreference.TypeConfigurations;
+ if (typeConfigurations != null)
+ {
+ foreach (TypeConfiguration typeConfiguration in typeConfigurations)
+ {
+ MappedModule mappedModule = typeConfiguration.MappedModule;
+ if (mappedModule != null)
+ {
+ Console.WriteLine("DuplicateCheckPreference TypeConfiguration MappedModule Id : " + mappedModule.Id);
+ Console.WriteLine("DuplicateCheckPreference TypeConfiguration MappedModule Name : " + mappedModule.Name);
+ Console.WriteLine("DuplicateCheckPreference TypeConfiguration MappedModule APIName : " + mappedModule.APIName);
+ }
+ List fieldMappings = typeConfiguration.FieldMappings;
+ if (fieldMappings != null)
+ {
+ foreach (FieldMappings fieldMapping in fieldMappings)
+ {
+ CurrentField currentField = fieldMapping.CurrentField;
+ if (currentField != null)
+ {
+ Console.WriteLine("DuplicateCheckPreference TypeConfiguration FieldMappings CurrentField Id : " + currentField.Id);
+ Console.WriteLine("DuplicateCheckPreference TypeConfiguration FieldMappings CurrentField Name : " + currentField.Name);
+ Console.WriteLine("DuplicateCheckPreference TypeConfiguration FieldMappings CurrentField APIName : " + currentField.APIName);
+ }
+ MappedField mappedField = fieldMapping.MappedField;
+ if (mappedField != null)
+ {
+ Console.WriteLine("DuplicateCheckPreference TypeConfiguration FieldMappings MappedField Id : " + mappedField.Id);
+ Console.WriteLine("DuplicateCheckPreference TypeConfiguration FieldMappings MappedField Name : " + mappedField.Name);
+ Console.WriteLine("DuplicateCheckPreference TypeConfiguration FieldMappings MappedField APIName : " + mappedField.APIName);
+ }
+ }
+ }
+ }
+ }
+ }
+ else if (responseHandler is APIException)
+ {
+ APIException exception = (APIException)responseHandler;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message.Value);
+ }
+ }
+ else if (response.StatusCode != 204)
+ {
+ Model responseObject = response.Model;
+ Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL").Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ string moduleAPIName = "Contacts";
+ GetDuplicateCheckPreference_1(moduleAPIName);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
+
diff --git a/versions/3.0.0/Samples/DuplicateCheckPreference1/UpdateDuplicateCheckPreference.cs b/versions/3.0.0/Samples/DuplicateCheckPreference1/UpdateDuplicateCheckPreference.cs
new file mode 100644
index 0000000..19f7362
--- /dev/null
+++ b/versions/3.0.0/Samples/DuplicateCheckPreference1/UpdateDuplicateCheckPreference.cs
@@ -0,0 +1,134 @@
+using System;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using Com.Zoho.Crm.API.DuplicateCheckPreference;
+using Com.Zoho.Crm.API.Util;
+using System.Collections.Generic;
+using System.Reflection;
+using Newtonsoft.Json;
+using Com.Zoho.Crm.API.Dc;
+using Com.Zoho.API.Authenticator;
+
+namespace Samples.DuplicateCheckPreference1
+{
+ public class UpdateDuplicateCheckPreference
+ {
+ public static void UpdateDuplicateCheckPreference_1(string moduleAPIName)
+ {
+ DuplicateCheckPreferenceOperations duplicateCheckPreferenceOperations = new DuplicateCheckPreferenceOperations(moduleAPIName);
+ BodyWrapper request = new BodyWrapper();
+ DuplicateCheckPreference duplicateCheckPreference = new DuplicateCheckPreference();
+ duplicateCheckPreference.Type = new Choice("mapped_module_records");
+
+ List typeConfigurations = new List();
+ TypeConfiguration typeConfiguration = new TypeConfiguration();
+ MappedModule mappedModule = new MappedModule();
+ mappedModule.Id = "34770612175";
+ mappedModule.APIName = "Leads";
+ typeConfiguration.MappedModule = mappedModule;
+ List fieldMappings = new List();
+ FieldMappings fieldMapping = new FieldMappings();
+ CurrentField currentField = new CurrentField();
+ currentField.Id = "347706106570001";
+ currentField.APIName = "Email_1";
+ fieldMapping.CurrentField = currentField;
+
+ MappedField mappedField = new MappedField();
+ mappedField.Id = "347706123537018";
+ mappedField.APIName = "Email_2";
+ fieldMapping.MappedField = mappedField;
+
+ fieldMappings.Add(fieldMapping);
+ typeConfiguration.FieldMappings = fieldMappings;
+ typeConfigurations.Add(typeConfiguration);
+ duplicateCheckPreference.TypeConfigurations = typeConfigurations;
+ request.DuplicateCheckPreference = duplicateCheckPreference;
+ APIResponse response = duplicateCheckPreferenceOperations.UpdateDuplicateCheckPreference(request);
+ if (response != null)
+ {
+ Console.WriteLine("Status Code: " + response.StatusCode);
+ if (response.IsExpected)
+ {
+ ActionHandler actionHandler = response.Object;
+ if (actionHandler is ActionWrapper)
+ {
+ ActionWrapper actionWrapper = (ActionWrapper)actionHandler;
+ ActionResponse actionresponse = actionWrapper.DuplicateCheckPreference;
+ if (actionresponse is SuccessResponse)
+ {
+ SuccessResponse successresponse = (SuccessResponse)actionresponse;
+ Console.WriteLine("Status: " + successresponse.Status.Value);
+ Console.WriteLine("Code: " + successresponse.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in successresponse.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + successresponse.Message);
+ }
+ else if (actionresponse is APIException)
+ {
+ APIException exception = (APIException)actionresponse;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message.Value);
+ }
+ }
+ else if (actionHandler is APIException)
+ {
+ APIException exception = (APIException)actionHandler;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message.Value);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL").Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ string moduleAPIName = "Contacts";
+ UpdateDuplicateCheckPreference_1(moduleAPIName);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
+
diff --git a/versions/3.0.0/Samples/Layouts/GetLayout.cs b/versions/3.0.0/Samples/Layouts/GetLayout.cs
new file mode 100644
index 0000000..c384edc
--- /dev/null
+++ b/versions/3.0.0/Samples/Layouts/GetLayout.cs
@@ -0,0 +1,495 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using Com.Zoho.API.Authenticator;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Com.Zoho.Crm.API;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using AssociationDetails = Com.Zoho.Crm.API.Fields.AssociationDetails;
+using AutoNumber = Com.Zoho.Crm.API.Fields.AutoNumber;
+using Crypt = Com.Zoho.Crm.API.Fields.Crypt;
+using Currency = Com.Zoho.Crm.API.Fields.Currency;
+using Formula = Com.Zoho.Crm.API.Fields.Formula;
+using HistoryTracking = Com.Zoho.Crm.API.Fields.HistoryTracking;
+using HistoryTrackingModule = Com.Zoho.Crm.API.Fields.HistoryTrackingModule;
+using Lookup = Com.Zoho.Crm.API.Fields.Lookup;
+using Maps = Com.Zoho.Crm.API.Fields.Maps;
+using Multiselectlookup = Com.Zoho.Crm.API.Fields.Multiselectlookup;
+using PickListValue = Com.Zoho.Crm.API.Fields.PickListValue;
+using Private = Com.Zoho.Crm.API.Fields.Private;
+using Unique = Com.Zoho.Crm.API.Fields.Unique;
+using ViewType = Com.Zoho.Crm.API.Fields.ViewType;
+using APIException = Com.Zoho.Crm.API.Layouts.APIException;
+using ConvertMapping = Com.Zoho.Crm.API.Layouts.ConvertMapping;
+using DealLayoutMapping = Com.Zoho.Crm.API.Layouts.DealLayoutMapping;
+using DefaultView = Com.Zoho.Crm.API.Layouts.DefaultView;
+using LayoutsOperations = Com.Zoho.Crm.API.Layouts.LayoutsOperations;
+using GetLayoutsParam = Com.Zoho.Crm.API.Layouts.LayoutsOperations.GetLayoutsParam;
+using MinifiedLayout = Com.Zoho.Crm.API.Layouts.MinifiedLayout;
+using Profiles = Com.Zoho.Crm.API.Layouts.Profiles;
+using Properties = Com.Zoho.Crm.API.Layouts.Properties;
+using ResponseHandler = Com.Zoho.Crm.API.Layouts.ResponseHandler;
+using ResponseWrapper = Com.Zoho.Crm.API.Layouts.ResponseWrapper;
+using Sections = Com.Zoho.Crm.API.Layouts.Sections;
+using SectionField = Com.Zoho.Crm.API.Layouts.SectionField;
+using Tooltip = Com.Zoho.Crm.API.Layouts.Tooltip;
+using MinifiedModule = Com.Zoho.Crm.API.Modules.MinifiedModule;
+using MinifiedUser = Com.Zoho.Crm.API.Users.MinifiedUser;
+using Com.Zoho.Crm.API.Util;
+using Com.Zoho.Crm.API.Dc;
+using Newtonsoft.Json;
+
+
+namespace Samples.Layouts
+{
+ public class GetLayout
+ {
+ public static void GetLayout_1(string moduleAPIName, long layoutId)
+ {
+ LayoutsOperations layoutsOperations = new LayoutsOperations();
+ ParameterMap paramInstance = new ParameterMap();
+ paramInstance.Add(GetLayoutsParam.MODULE, moduleAPIName);
+ APIResponse response = layoutsOperations.GetLayout(layoutId, paramInstance);
+ if (response != null)
+ {
+ Console.WriteLine("Status Code: " + response.StatusCode);
+ if (new List() { 204, 304 }.Contains(response.StatusCode))
+ {
+ Console.WriteLine(response.StatusCode == 204 ? "No Content" : "Not Modified");
+ return;
+ }
+ if (response.IsExpected)
+ {
+ ResponseHandler responseHandler = response.Object;
+ if (responseHandler is ResponseWrapper)
+ {
+ ResponseWrapper responseWrapper = (ResponseWrapper)responseHandler;
+ List layouts = responseWrapper.Layouts;
+ foreach (Com.Zoho.Crm.API.Layouts.Layouts layout in layouts)
+ {
+ if (layout.CreatedTime != null)
+ {
+ Console.WriteLine("Layout CreatedTime: " + layout.CreatedTime);
+ }
+ if (layout.ConvertMapping != null)
+ {
+ ConvertMapping convertMapping = layout.ConvertMapping;
+ MinifiedLayout accounts = convertMapping.Accounts;
+ MinifiedLayout contacts = convertMapping.Contacts;
+ DealLayoutMapping deals = convertMapping.Deals;
+ }
+ Console.WriteLine("Layout Visible: " + layout.Visible);
+ MinifiedUser createdFor = layout.CreatedFor;
+ if (createdFor != null)
+ {
+ Console.WriteLine("Layout CreatedFor User-Name: " + createdFor.Name);
+ Console.WriteLine("Layout CreatedFor User-ID: " + createdFor.Id);
+ Console.WriteLine("Layout CreatedFor User-Email: " + createdFor.Email);
+ }
+ List profiles = layout.Profiles;
+ if (profiles != null)
+ {
+ foreach (Profiles profile in profiles)
+ {
+ Console.WriteLine("Layout Profile Default: " + profile.Default);
+ Console.WriteLine("Layout Profile Name: " + profile.Name);
+ Console.WriteLine("Layout Profile ID: " + profile.Id);
+ DefaultView defaultView = profile.Defaultview;
+ if (defaultView != null)
+ {
+ Console.WriteLine("Layout Profile DefaultView Name: " + defaultView.Name);
+ Console.WriteLine("Layout Profile DefaultView ID: " + defaultView.Id);
+ Console.WriteLine("Layout Profile DefaultView Type: " + defaultView.Type);
+ }
+ }
+ }
+ MinifiedUser createdBy = layout.CreatedBy;
+ if (createdBy != null)
+ {
+ Console.WriteLine("Layout CreatedBy User-Name: " + createdBy.Name);
+ Console.WriteLine("Layout CreatedBy User-ID: " + createdBy.Id);
+ Console.WriteLine("Layout CreatedBy User-Email: " + createdBy.Email);
+ }
+ List sections = layout.Sections;
+ if (sections != null)
+ {
+ foreach (Sections section in sections)
+ {
+ Console.WriteLine("Layout Section DisplayLabel: " + section.DisplayLabel);
+ Console.WriteLine("Layout Section SequenceNumber: " + section.SequenceNumber);
+ Console.WriteLine("Layout Section IsSubformSection: " + section.Issubformsection);
+ Console.WriteLine("Layout Section TabTraversal: " + section.TabTraversal);
+ Console.WriteLine("Layout Section APIName: " + section.APIName);
+ Console.WriteLine("Layout Section ColumnCount: " + section.ColumnCount);
+ Console.WriteLine("Layout Section Name: " + section.Name);
+ Console.WriteLine("Layout Section GeneratedType: " + section.GeneratedType);
+ Console.WriteLine("Layout Section Type: " + section.Type);
+ List fields = section.Fields;
+ if (fields != null)
+ {
+ foreach (Com.Zoho.Crm.API.Fields.Fields field in fields)
+ {
+ PrintField(field);
+ }
+ }
+ Properties properties = section.Properties;
+ if (properties != null)
+ {
+ Console.WriteLine("Layout Section Properties ReorderRows: " + properties.ReorderRows);
+ Tooltip tooltip = properties.Tooltip;
+ if (tooltip != null)
+ {
+ Console.WriteLine("Layout Section Properties ToolTip Name: " + tooltip.Name);
+ Console.WriteLine("Layout Section Properties ToolTip Value: " + tooltip.Value);
+ }
+ Console.WriteLine("Layout Section Properties MaximumRows: " + properties.MaximumRows);
+ }
+ }
+ }
+ Console.WriteLine("Layout buisness card: " + layout.ShowBusinessCard);
+ if (layout.ModifiedTime != null)
+ {
+ Console.WriteLine("Layout ModifiedTime: " + layout.ModifiedTime);
+ }
+ Console.WriteLine("Layout Name: " + layout.Name);
+ MinifiedUser modifiedBy = layout.ModifiedBy;
+ if (modifiedBy != null)
+ {
+ Console.WriteLine("Layout ModifiedBy User-Name: " + modifiedBy.Name);
+ Console.WriteLine("Layout ModifiedBy User-ID: " + modifiedBy.Id);
+ Console.WriteLine("Layout ModifiedBy User-Email: " + modifiedBy.Email);
+ }
+ Console.WriteLine("Layout ID: " + layout.Id);
+ Console.WriteLine("Layout Status: " + layout.Status);
+ Console.WriteLine("Layout DisplayType : " + layout.DisplayType);
+ }
+ }
+ else if (responseHandler is APIException)
+ {
+ APIException exception = (APIException)responseHandler;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+ private static void PrintField(Com.Zoho.Crm.API.Fields.Fields field)
+ {
+ Console.WriteLine("Field SystemMandatory: " + field.SystemMandatory);
+ Console.WriteLine("Field Webhook: " + field.Webhook);
+ Console.WriteLine("Field JsonType: " + field.JsonType);
+ Private privateInfo = field.Private;
+ if (privateInfo != null)
+ {
+ Console.WriteLine("Private Details");
+ Console.WriteLine("Field Private Type: " + privateInfo.Type);
+ Console.WriteLine("Field Private Export: " + privateInfo.Export);
+ Console.WriteLine("Field Private Restricted: " + privateInfo.Restricted);
+ }
+ Crypt crypt = field.Crypt;
+ if (crypt != null)
+ {
+ Console.WriteLine("Field Crypt Mode: " + crypt.Mode);
+ Console.WriteLine("Field Crypt Column: " + crypt.Column);
+ Console.WriteLine("Field Crypt Table: " + crypt.Table);
+ Console.WriteLine("Field Crypt Status: " + crypt.Status);
+ List encFldIds = crypt.Encfldids;
+ if (encFldIds != null)
+ {
+ Console.WriteLine("EncFldIds : ");
+ foreach (string encFldId in encFldIds)
+ {
+ Console.WriteLine(encFldId);
+ }
+ }
+ Console.WriteLine("Field Crypt Notify: " + crypt.Notify);
+ }
+ Console.WriteLine("Field FieldLabel: " + field.FieldLabel);
+ Com.Zoho.Crm.API.Fields.Tooltip tooltip = field.Tooltip;
+ if (tooltip != null)
+ {
+ Console.WriteLine("Field ToolTip Name: " + tooltip.Name);
+ Console.WriteLine("Field ToolTip Value: " + tooltip.Value);
+ }
+ Console.WriteLine("Field CreatedSource: " + field.CreatedSource);
+ Console.WriteLine("Field FieldReadOnly: " + field.FieldReadOnly);
+ Console.WriteLine("Field DisplayLabel: " + field.DisplayLabel);
+ Console.WriteLine("Field ReadOnly: " + field.ReadOnly);
+ AssociationDetails associationDetails = field.AssociationDetails;
+ if (associationDetails != null)
+ {
+ MinifiedModule lookupField = associationDetails.LookupField;
+ if (lookupField != null)
+ {
+ Console.WriteLine("Field AssociationDetails LookupField ID: " + lookupField.Id);
+ Console.WriteLine("Field AssociationDetails LookupField Name: " + lookupField.APIName);
+ }
+ MinifiedModule relatedField = associationDetails.RelatedField;
+ if (relatedField != null)
+ {
+ Console.WriteLine("Field AssociationDetails RelatedField ID: " + relatedField.Id);
+ Console.WriteLine("Field AssociationDetails RelatedField Name: " + relatedField.APIName);
+ }
+ }
+ Console.WriteLine("Field Filterable: " + field.Filterable);
+ if (field.ConvertMapping != null)
+ {
+ if (field.ConvertMapping != null)
+ {
+ Com.Zoho.Crm.API.Fields.ConvertMapping convertMapping = field.ConvertMapping;
+ Console.WriteLine(convertMapping.Accounts);
+ Console.WriteLine(convertMapping.Contacts);
+ Console.WriteLine(convertMapping.Deals);
+ }
+ }
+ if (field.HistoryTracking != null)
+ {
+ HistoryTracking historytracking = field.HistoryTracking;
+ HistoryTrackingModule module = historytracking.Module;
+ if (module != null)
+ {
+ Com.Zoho.Crm.API.Layouts.Layouts moduleLayout = module.Layout;
+ if (moduleLayout != null)
+ {
+ Console.WriteLine("Module layout id" + moduleLayout.Id);
+ }
+ Console.WriteLine("Module layout display label" + module.DisplayLabel);
+ Console.WriteLine("Module layout api name" + module.APIName);
+ Console.WriteLine("Module layout module" + module.Id);
+ Console.WriteLine("Module layout id" + module.Module);
+ Console.WriteLine("Module layout module name" + module.ModuleName);
+ }
+ MinifiedModule durationConfigured = historytracking.DurationConfiguredField;
+ if (durationConfigured != null)
+ {
+ Console.WriteLine("historytracking duration configured field" + durationConfigured.Id);
+ }
+ }
+ Console.WriteLine("Field BusinesscardSupported: " + field.BusinesscardSupported);
+ Currency currency = field.Currency;
+ if (currency != null)
+ {
+ Console.WriteLine("Field Currency RoundingOption: " + currency.RoundingOption);
+ if (currency.Precision != null)
+ {
+ Console.WriteLine("Field Currency Precision: " + currency.Precision);
+ }
+ }
+ Console.WriteLine("Field ID: " + field.Id);
+ if (field.CustomField != null)
+ {
+ Console.WriteLine("Field CustomField: " + field.CustomField);
+ }
+ Lookup lookup = field.Lookup;
+ if (lookup != null)
+ {
+ Console.WriteLine("Field ModuleLookup DisplayLabel: " + lookup.DisplayLabel);
+ Console.WriteLine("Field ModuleLookup APIName: " + lookup.APIName);
+ Console.WriteLine("Field ModuleLookup Module: " + lookup.Module);
+ if (lookup.Id != null)
+ {
+ Console.WriteLine("Field ModuleLookup ID: " + lookup.Id);
+ }
+ }
+ if (field.Visible != null)
+ {
+ Console.WriteLine("Field Visible: " + field.Visible);
+ }
+ if (field.PickListValuesSortedLexically != null)
+ {
+ Console.WriteLine("Field pick list values lexically sorted: " + field.PickListValuesSortedLexically);
+ }
+ if (field.Sortable != null)
+ {
+ Console.WriteLine("Field sortable " + field.Sortable);
+ }
+ if (field.UiType != null)
+ {
+ Console.WriteLine("Field UI tyle " + field.UiType);
+ }
+ if (field.SequenceNumber != null)
+ {
+ Console.WriteLine("Field sequence number " + field.SequenceNumber);
+ }
+ List fieldProfiles = field.Profiles;
+ if(fieldProfiles != null)
+ {
+ foreach (Com.Zoho.Crm.API.Fields.Profile fieldProfile in fieldProfiles)
+ {
+ Console.WriteLine("Profile permission Type " + fieldProfile.PermissionType);
+ Console.WriteLine("Profile Name " + fieldProfile.Name);
+ Console.WriteLine("Profile ID " + fieldProfile.Id);
+ }
+ }
+ if (field.Length != null)
+ {
+ Console.WriteLine("Field Length: " + field.Length);
+ }
+ ViewType viewType = field.ViewType;
+ if (viewType != null)
+ {
+ Console.WriteLine("Field ViewType View: " + viewType.View);
+ Console.WriteLine("Field ViewType Edit: " + viewType.Edit);
+ Console.WriteLine("Field ViewType Create: " + viewType.Create);
+ Console.WriteLine("Field ViewType QuickCreate: " + viewType.QuickCreate);
+ }
+ MinifiedModule subform = field.AssociatedModule;
+ if (subform != null)
+ {
+ Console.WriteLine("Field Subform Module: " + subform.Module);
+ Console.WriteLine("Field Subform ID: " + subform.Id);
+ }
+ Console.WriteLine("Field APIName: " + field.APIName);
+ object unique1 = field.Unique;
+ if (unique1 != null)
+ {
+ if (unique1 is Unique)
+ {
+ Unique unique = (Unique)unique1;
+ Console.WriteLine("Field Unique Casesensitive : " + unique.Casesensitive);
+ }
+ else
+ {
+ Console.WriteLine("Field Unique : " + unique1);
+ }
+ }
+ Console.WriteLine("Field DataType: " + field.DataType);
+ Formula formula = field.Formula;
+ if (formula != null)
+ {
+ Console.WriteLine("Field Formula ReturnType : " + formula.ReturnType);
+ if (formula.Expression != null)
+ {
+ Console.WriteLine("Field Formula Expression : " + formula.Expression);
+ }
+ }
+ if (field.DecimalPlace != null)
+ {
+ Console.WriteLine("Field DecimalPlace: " + field.DecimalPlace);
+ }
+ Console.WriteLine("Field MassUpdate: " + field.MassUpdate);
+ if (field.BlueprintSupported != null)
+ {
+ Console.WriteLine("Field BlueprintSupported: " + field.BlueprintSupported);
+ }
+ Multiselectlookup multiSelectLookup = field.Multiselectlookup;
+ if (multiSelectLookup != null)
+ {
+ Console.WriteLine("Field MultiSelectLookup DisplayLabel: " + multiSelectLookup.DisplayLabel);
+ Console.WriteLine("Field MultiSelectLookup LinkingModule: " + multiSelectLookup.LinkingModule);
+ Console.WriteLine("Field MultiSelectLookup LookupApiname: " + multiSelectLookup.LookupApiname);
+ Console.WriteLine("Field MultiSelectLookup APIName: " + multiSelectLookup.APIName);
+ Console.WriteLine("Field MultiSelectLookup ConnectedlookupApiname: " + multiSelectLookup.ConnectedlookupApiname);
+ Console.WriteLine("Field MultiSelectLookup ID: " + multiSelectLookup.Id);
+ Console.WriteLine("Field MultiSelectLookup connected module: " + multiSelectLookup.ConnectedModule);
+ }
+ List pickListValues = field.PickListValues;
+ if (pickListValues != null)
+ {
+ foreach (PickListValue pickListValue in pickListValues)
+ {
+ PrintPickListValue(pickListValue);
+ }
+ }
+ AutoNumber autoNumber = field.Autonumber;
+ if (autoNumber != null)
+ {
+ Console.WriteLine("Field AutoNumber Prefix: " + autoNumber.Prefix);
+ Console.WriteLine("Field AutoNumber Suffix: " + autoNumber.Suffix);
+ if (autoNumber.StartNumber != null)
+ {
+ Console.WriteLine("Field AutoNumber StartNumber: " + autoNumber.StartNumber);
+ }
+ }
+ if (field.DefaultValue != null)
+ {
+ Console.WriteLine("Field DefaultValue: " + field.DefaultValue);
+ }
+ if (field.DisplayType != null)
+ {
+ Console.WriteLine("Field display type : " + field.DisplayType);
+ }
+ Console.WriteLine("Get field type" + field.Type);
+ if (field.External != null)
+ {
+ Console.WriteLine("Get External show " + field.External.Show);
+ Console.WriteLine("Get External type" + field.External.Type);
+ Console.WriteLine("allow multiple config" + field.External.AllowMultipleConfig);
+ }
+ if (field.Multiuserlookup != null)
+ {
+ Multiselectlookup multiuserlookup = field.Multiuserlookup;
+ Console.WriteLine("Get Multiselectlookup DisplayLabel" + multiuserlookup.DisplayLabel);
+ Console.WriteLine("Get Multiselectlookup LinkingModule" + multiuserlookup.LinkingModule);
+ Console.WriteLine("Get Multiselectlookup LookupAPIName" + multiuserlookup.LookupApiname);
+ Console.WriteLine("Get Multiselectlookup APIName" + multiuserlookup.APIName);
+ Console.WriteLine("Get Multiselectlookup Id" + multiuserlookup.Id);
+ Console.WriteLine("Get Multiselectlookup ConnectedModule" + multiuserlookup.ConnectedModule);
+ Console.WriteLine("Get Multiselectlookup ConnectedlookupAPIName" + multiuserlookup.ConnectedlookupApiname);
+ }
+ }
+ public static void PrintPickListValue(PickListValue pickListValue)
+ {
+ Console.WriteLine(" Fields PickListValue DisplayValue: " + pickListValue.DisplayValue);
+ Console.WriteLine(" Fields PickListValue SequenceNumber: " + pickListValue.SequenceNumber);
+ Console.WriteLine(" Fields PickListValue ExpectedDataType: " + pickListValue.ExpectedDataType);
+ Console.WriteLine(" Fields PickListValue ActualValue: " + pickListValue.ActualValue);
+ Console.WriteLine(" Fields PickListValue SysRefName: " + pickListValue.SysRefName);
+ Console.WriteLine(" Fields PickListValue Type: " + pickListValue.Type);
+ Console.WriteLine(" Fields PickListValue Id: " + pickListValue.Id);
+ foreach (Maps map in pickListValue.Maps)
+ {
+ Console.WriteLine(map);
+ List pickListValues = map.PickListValues;
+ if (pickListValues != null)
+ {
+ foreach (PickListValue plv in pickListValues)
+ {
+ Console.WriteLine(plv);
+ }
+ }
+ }
+ }
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL").Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ string moduleAPIName = "Leads";
+ long layoutId = 4402480167l;
+ GetLayout_1(moduleAPIName, layoutId);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/versions/3.0.0/Samples/Layouts/GetLayouts.cs b/versions/3.0.0/Samples/Layouts/GetLayouts.cs
new file mode 100644
index 0000000..8766c8e
--- /dev/null
+++ b/versions/3.0.0/Samples/Layouts/GetLayouts.cs
@@ -0,0 +1,498 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using Com.Zoho.API.Authenticator;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Com.Zoho.Crm.API;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using AssociationDetails = Com.Zoho.Crm.API.Fields.AssociationDetails;
+using AutoNumber = Com.Zoho.Crm.API.Fields.AutoNumber;
+using Crypt = Com.Zoho.Crm.API.Fields.Crypt;
+using Currency = Com.Zoho.Crm.API.Fields.Currency;
+using Fields = Com.Zoho.Crm.API.Fields.Fields;
+using Formula = Com.Zoho.Crm.API.Fields.Formula;
+using HistoryTracking = Com.Zoho.Crm.API.Fields.HistoryTracking;
+using HistoryTrackingModule = Com.Zoho.Crm.API.Fields.HistoryTrackingModule;
+using Lookup = Com.Zoho.Crm.API.Fields.Lookup;
+using Maps = Com.Zoho.Crm.API.Fields.Maps;
+using Multiselectlookup = Com.Zoho.Crm.API.Fields.Multiselectlookup;
+using PickListValue = Com.Zoho.Crm.API.Fields.PickListValue;
+using Private = Com.Zoho.Crm.API.Fields.Private;
+using Unique = Com.Zoho.Crm.API.Fields.Unique;
+using ViewType = Com.Zoho.Crm.API.Fields.ViewType;
+using APIException = Com.Zoho.Crm.API.Layouts.APIException;
+using ConvertMapping = Com.Zoho.Crm.API.Layouts.ConvertMapping;
+using DealLayoutMapping = Com.Zoho.Crm.API.Layouts.DealLayoutMapping;
+using DefaultView = Com.Zoho.Crm.API.Layouts.DefaultView;
+using LayoutsOperations = Com.Zoho.Crm.API.Layouts.LayoutsOperations;
+using Profiles = Com.Zoho.Crm.API.Layouts.Profiles;
+using Properties = Com.Zoho.Crm.API.Layouts.Properties;
+using ResponseHandler = Com.Zoho.Crm.API.Layouts.ResponseHandler;
+using ResponseWrapper = Com.Zoho.Crm.API.Layouts.ResponseWrapper;
+using Sections = Com.Zoho.Crm.API.Layouts.Sections;
+using SectionField = Com.Zoho.Crm.API.Layouts.SectionField;
+using Tooltip = Com.Zoho.Crm.API.Layouts.Tooltip;
+using MinifiedModule = Com.Zoho.Crm.API.Modules.MinifiedModule;
+using GetLayoutsParam = Com.Zoho.Crm.API.Layouts.LayoutsOperations.GetLayoutsParam;
+using MinifiedLayout = Com.Zoho.Crm.API.Layouts.MinifiedLayout;
+using MinifiedUser = Com.Zoho.Crm.API.Users.MinifiedUser;
+using Com.Zoho.Crm.API.Util;
+using Com.Zoho.Crm.API.Dc;
+using Newtonsoft.Json;
+
+
+namespace Samples.Layouts
+{
+ public class GetLayouts
+ {
+ public static void GetLayouts_1(string moduleAPIName)
+ {
+ LayoutsOperations layoutsOperations = new LayoutsOperations();
+ ParameterMap paramInstance = new ParameterMap();
+ paramInstance.Add(GetLayoutsParam.MODULE, moduleAPIName);
+ APIResponse response = layoutsOperations.GetLayouts(paramInstance);
+ if (response != null)
+ {
+ Console.WriteLine("Status Code: " + response.StatusCode);
+ if (new List() { 204, 304 }.Contains(response.StatusCode))
+ {
+ Console.WriteLine(response.StatusCode == 204 ? "No Content" : "Not Modified");
+ return;
+ }
+ if (response.IsExpected)
+ {
+ ResponseHandler responseHandler = response.Object;
+ if (responseHandler is ResponseWrapper)
+ {
+ ResponseWrapper responseWrapper = (ResponseWrapper)responseHandler;
+ List layouts = responseWrapper.Layouts;
+ foreach (Com.Zoho.Crm.API.Layouts.Layouts layout in layouts)
+ {
+ if (layout.CreatedTime != null)
+ {
+ Console.WriteLine("Layout CreatedTime: " + layout.CreatedTime);
+ }
+ if (layout.ConvertMapping != null)
+ {
+ ConvertMapping convertMapping = layout.ConvertMapping;
+ MinifiedLayout accounts = convertMapping.Accounts;
+ MinifiedLayout contacts = convertMapping.Contacts;
+ DealLayoutMapping deals = convertMapping.Deals;
+ }
+ Console.WriteLine("Layout Visible: " + layout.Visible);
+ MinifiedUser createdFor = layout.CreatedFor;
+ if (createdFor != null)
+ {
+ Console.WriteLine("Layout CreatedFor User-Name: " + createdFor.Name);
+ Console.WriteLine("Layout CreatedFor User-ID: " + createdFor.Id);
+ Console.WriteLine("Layout CreatedFor User-Email: " + createdFor.Email);
+ }
+ List profiles = layout.Profiles;
+ if (profiles != null)
+ {
+ foreach (Profiles profile in profiles)
+ {
+ Console.WriteLine("Layout Profile Default: " + profile.Default);
+ Console.WriteLine("Layout Profile Name: " + profile.Name);
+ Console.WriteLine("Layout Profile ID: " + profile.Id);
+ DefaultView defaultView = profile.Defaultview;
+ if (defaultView != null)
+ {
+ Console.WriteLine("Layout Profile DefaultView Name: " + defaultView.Name);
+ Console.WriteLine("Layout Profile DefaultView ID: " + defaultView.Id);
+ Console.WriteLine("Layout Profile DefaultView Type: " + defaultView.Type);
+ }
+ }
+ }
+ MinifiedUser createdBy = layout.CreatedBy;
+ if (createdBy != null)
+ {
+ Console.WriteLine("Layout CreatedBy User-Name: " + createdBy.Name);
+ Console.WriteLine("Layout CreatedBy User-ID: " + createdBy.Id);
+ Console.WriteLine("Layout CreatedBy User-Email: " + createdBy.Email);
+ }
+ List sections = layout.Sections;
+ if (sections != null)
+ {
+ foreach (Sections section in sections)
+ {
+ Console.WriteLine("Layout Section DisplayLabel: " + section.DisplayLabel);
+ Console.WriteLine("Layout Section SequenceNumber: " + section.SequenceNumber);
+ Console.WriteLine("Layout Section IsSubformSection: " + section.Issubformsection);
+ Console.WriteLine("Layout Section TabTraversal: " + section.TabTraversal);
+ Console.WriteLine("Layout Section APIName: " + section.APIName);
+ Console.WriteLine("Layout Section ColumnCount: " + section.ColumnCount);
+ Console.WriteLine("Layout Section Name: " + section.Name);
+ Console.WriteLine("Layout Section GeneratedType: " + section.GeneratedType);
+ Console.WriteLine("Layout Section Type: " + section.Type);
+ List fields = section.Fields;
+ if (fields != null)
+ {
+ foreach (Com.Zoho.Crm.API.Fields.Fields field in fields)
+ {
+ PrintField(field);
+ }
+ }
+ Properties properties = section.Properties;
+ if (properties != null)
+ {
+ Console.WriteLine("Layout Section Properties ReorderRows: " + properties.ReorderRows);
+ Tooltip tooltip = properties.Tooltip;
+ if (tooltip != null)
+ {
+ Console.WriteLine("Layout Section Properties ToolTip Name:" + tooltip.Name);
+ Console.WriteLine("Layout Section Properties ToolTip Value:" + tooltip.Value);
+ }
+ Console.WriteLine("Layout Section Properties MaximumRows: " + properties.MaximumRows);
+ }
+ }
+ }
+ Console.WriteLine("Layout buisness card: " + layout.ShowBusinessCard);
+ if (layout.ModifiedTime != null)
+ {
+ Console.WriteLine("Layout ModifiedTime: " + layout.ModifiedTime);
+ }
+ Console.WriteLine("Layout Name: " + layout.Name);
+ MinifiedUser modifiedBy = layout.ModifiedBy;
+ if (modifiedBy != null)
+ {
+ Console.WriteLine("Layout ModifiedBy User-Name: " + modifiedBy.Name);
+ Console.WriteLine("Layout ModifiedBy User-ID: " + modifiedBy.Id);
+ Console.WriteLine("Layout ModifiedBy User-Email: " + modifiedBy.Email);
+ }
+ Console.WriteLine("Layout ID: " + layout.Id);
+ Console.WriteLine("Layout Status: " + layout.Status);
+ Console.WriteLine("Layout DisplayType : " + layout.DisplayType);
+ }
+ }
+ else if (responseHandler is APIException)
+ {
+ APIException exception = (APIException)responseHandler;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+
+ private static void PrintField(Com.Zoho.Crm.API.Fields.Fields field)
+ {
+ Console.WriteLine("Field SystemMandatory: " + field.SystemMandatory);
+ Console.WriteLine("Field Webhook: " + field.Webhook);
+ Console.WriteLine("Field JsonType: " + field.JsonType);
+ Private privateInfo = field.Private;
+ if (privateInfo != null)
+ {
+ Console.WriteLine("Private Details");
+ Console.WriteLine("Field Private Type: " + privateInfo.Type);
+ Console.WriteLine("Field Private Export: " + privateInfo.Export);
+ Console.WriteLine("Field Private Restricted: " + privateInfo.Restricted);
+ }
+ Crypt crypt = field.Crypt;
+ if (crypt != null)
+ {
+ Console.WriteLine("Field Crypt Mode: " + crypt.Mode);
+ Console.WriteLine("Field Crypt Column: " + crypt.Column);
+ Console.WriteLine("Field Crypt Table: " + crypt.Table);
+ Console.WriteLine("Field Crypt Status: " + crypt.Status);
+ List encFldIds = crypt.Encfldids;
+ if (encFldIds != null)
+ {
+ Console.WriteLine("EncFldIds : ");
+ foreach (string encFldId in encFldIds)
+ {
+ Console.WriteLine(encFldId);
+ }
+ }
+ Console.WriteLine("Field Crypt Notify: " + crypt.Notify);
+ }
+ Console.WriteLine("Field FieldLabel: " + field.FieldLabel);
+ Com.Zoho.Crm.API.Fields.Tooltip tooltip = field.Tooltip;
+ if (tooltip != null)
+ {
+ Console.WriteLine("Field ToolTip Name: " + tooltip.Name);
+ Console.WriteLine("Field ToolTip Value: " + tooltip.Value);
+ }
+ Console.WriteLine("Field CreatedSource: " + field.CreatedSource);
+ Console.WriteLine("Field FieldReadOnly: " + field.FieldReadOnly);
+ Console.WriteLine("Field DisplayLabel: " + field.DisplayLabel);
+ Console.WriteLine("Field ReadOnly: " + field.ReadOnly);
+ AssociationDetails associationDetails = field.AssociationDetails;
+ if (associationDetails != null)
+ {
+ MinifiedModule lookupField = associationDetails.LookupField;
+ if (lookupField != null)
+ {
+ Console.WriteLine("Field AssociationDetails LookupField ID: " + lookupField.Id);
+ Console.WriteLine("Field AssociationDetails LookupField Name: " + lookupField.APIName);
+ }
+ MinifiedModule relatedField = associationDetails.RelatedField;
+ if (relatedField != null)
+ {
+ Console.WriteLine("Field AssociationDetails RelatedField ID: " + relatedField.Id);
+ Console.WriteLine("Field AssociationDetails RelatedField Name: " + relatedField.APIName);
+ }
+ }
+ Console.WriteLine("Field Filterable: " + field.Filterable);
+ if (field.ConvertMapping != null)
+ {
+ if (field.ConvertMapping != null)
+ {
+ Com.Zoho.Crm.API.Fields.ConvertMapping convertMapping = field.ConvertMapping;
+ Console.WriteLine(convertMapping.Accounts);
+ Console.WriteLine(convertMapping.Contacts);
+ Console.WriteLine(convertMapping.Deals);
+ }
+ }
+ if (field.HistoryTracking != null)
+ {
+ HistoryTracking historytracking = field.HistoryTracking;
+ HistoryTrackingModule module = historytracking.Module;
+ if (module != null)
+ {
+ Com.Zoho.Crm.API.Layouts.Layouts moduleLayout = module.Layout;
+ if (moduleLayout != null)
+ {
+ Console.WriteLine("Module layout id" + moduleLayout.Id);
+ }
+ Console.WriteLine("Module layout display label" + module.DisplayLabel);
+ Console.WriteLine("Module layout api name" + module.APIName);
+ Console.WriteLine("Module layout module" + module.Id);
+ Console.WriteLine("Module layout id" + module.Module);
+ Console.WriteLine("Module layout module name" + module.ModuleName);
+ }
+ MinifiedModule durationConfigured = historytracking.DurationConfiguredField;
+ if (durationConfigured != null)
+ {
+ Console.WriteLine("historytracking duration configured field" + durationConfigured.Id);
+ }
+ }
+ Console.WriteLine("Field BusinesscardSupported: " + field.BusinesscardSupported);
+ Currency currency = field.Currency;
+ if (currency != null)
+ {
+ Console.WriteLine("Field Currency RoundingOption: " + currency.RoundingOption);
+ if (currency.Precision != null)
+ {
+ Console.WriteLine("Field Currency Precision: " + currency.Precision);
+ }
+ }
+ Console.WriteLine("Field ID: " + field.Id);
+ if (field.CustomField != null)
+ {
+ Console.WriteLine("Field CustomField: " + field.CustomField);
+ }
+ Lookup lookup = field.Lookup;
+ if (lookup != null)
+ {
+ Console.WriteLine("Field ModuleLookup DisplayLabel: " + lookup.DisplayLabel);
+ Console.WriteLine("Field ModuleLookup APIName: " + lookup.APIName);
+ Console.WriteLine("Field ModuleLookup Module: " + lookup.Module);
+ if (lookup.Id != null)
+ {
+ Console.WriteLine("Field ModuleLookup ID: " + lookup.Id);
+ }
+ }
+ if (field.Visible != null)
+ {
+ Console.WriteLine("Field Visible: " + field.Visible);
+ }
+ if (field.PickListValuesSortedLexically != null)
+ {
+ Console.WriteLine("Field pick list values lexically sorted: " + field.PickListValuesSortedLexically);
+ }
+ if (field.Sortable != null)
+ {
+ Console.WriteLine("Field sortable " + field.Sortable);
+ }
+ if (field.UiType != null)
+ {
+ Console.WriteLine("Field UI tyle " + field.UiType);
+ }
+ if (field.SequenceNumber != null)
+ {
+ Console.WriteLine("Field sequence number " + field.SequenceNumber);
+ }
+ List fieldProfiles = field.Profiles;
+ if (fieldProfiles != null)
+ {
+ foreach (Com.Zoho.Crm.API.Fields.Profile fieldProfile in fieldProfiles)
+ {
+ Console.WriteLine("Profile permission Type " + fieldProfile.PermissionType);
+ Console.WriteLine("Profile Name " + fieldProfile.Name);
+ Console.WriteLine("Profile ID " + fieldProfile.Id);
+ }
+ }
+ if (field.Length != null)
+ {
+ Console.WriteLine("Field Length: " + field.Length);
+ }
+ ViewType viewType = field.ViewType;
+ if (viewType != null)
+ {
+ Console.WriteLine("Field ViewType View: " + viewType.View);
+ Console.WriteLine("Field ViewType Edit: " + viewType.Edit);
+ Console.WriteLine("Field ViewType Create: " + viewType.Create);
+ Console.WriteLine("Field ViewType QuickCreate: " + viewType.QuickCreate);
+ }
+ MinifiedModule subform = field.AssociatedModule;
+ if (subform != null)
+ {
+ Console.WriteLine("Field Subform Module: " + subform.Module);
+ Console.WriteLine("Field Subform ID: " + subform.Id);
+ }
+ Console.WriteLine("Field APIName: " + field.APIName);
+ object unique1 = field.Unique;
+ if (unique1 != null)
+ {
+ if (unique1 is Unique)
+ {
+ Unique unique = (Unique)unique1;
+ Console.WriteLine("Field Unique Casesensitive : " + unique.Casesensitive);
+ }
+ else
+ {
+ Console.WriteLine("Field Unique : " + unique1);
+ }
+ }
+ Console.WriteLine("Field DataType: " + field.DataType);
+ Formula formula = field.Formula;
+ if (formula != null)
+ {
+ Console.WriteLine("Field Formula ReturnType : " + formula.ReturnType);
+ if (formula.Expression != null)
+ {
+ Console.WriteLine("Field Formula Expression : " + formula.Expression);
+ }
+ }
+ if (field.DecimalPlace != null)
+ {
+ Console.WriteLine("Field DecimalPlace: " + field.DecimalPlace);
+ }
+ Console.WriteLine("Field MassUpdate: " + field.MassUpdate);
+ if (field.BlueprintSupported != null)
+ {
+ Console.WriteLine("Field BlueprintSupported: " + field.BlueprintSupported);
+ }
+ Multiselectlookup multiSelectLookup = field.Multiselectlookup;
+ if (multiSelectLookup != null)
+ {
+ Console.WriteLine("Field MultiSelectLookup DisplayLabel: " + multiSelectLookup.DisplayLabel);
+ Console.WriteLine("Field MultiSelectLookup LinkingModule: " + multiSelectLookup.LinkingModule);
+ Console.WriteLine("Field MultiSelectLookup LookupApiname: " + multiSelectLookup.LookupApiname);
+ Console.WriteLine("Field MultiSelectLookup APIName: " + multiSelectLookup.APIName);
+ Console.WriteLine("Field MultiSelectLookup ConnectedlookupApiname: " + multiSelectLookup.ConnectedlookupApiname);
+ Console.WriteLine("Field MultiSelectLookup ID: " + multiSelectLookup.Id);
+ Console.WriteLine("Field MultiSelectLookup connected module: " + multiSelectLookup.ConnectedModule);
+ }
+ List pickListValues = field.PickListValues;
+ if (pickListValues != null)
+ {
+ foreach (PickListValue pickListValue in pickListValues)
+ {
+ PrintPickListValue(pickListValue);
+ }
+ }
+ AutoNumber autoNumber = field.AutoNumber61;
+ if (autoNumber != null)
+ {
+ Console.WriteLine("Field AutoNumber Prefix: " + autoNumber.Prefix);
+ Console.WriteLine("Field AutoNumber Suffix: " + autoNumber.Suffix);
+ if (autoNumber.StartNumber != null)
+ {
+ Console.WriteLine("Field AutoNumber StartNumber: " + autoNumber.StartNumber);
+ }
+ }
+ if (field.DefaultValue != null)
+ {
+ Console.WriteLine("Field DefaultValue: " + field.DefaultValue);
+ }
+ if (field.DisplayType != null)
+ {
+ Console.WriteLine("Field display type : " + field.DisplayType);
+ }
+ Console.WriteLine("Get field type" + field.Type);
+ if (field.External != null)
+ {
+ Console.WriteLine("Get External show " + field.External.Show);
+ Console.WriteLine("Get External type" + field.External.Type);
+ Console.WriteLine("allow multiple config" + field.External.AllowMultipleConfig);
+ }
+ if (field.Multiuserlookup != null)
+ {
+ Multiselectlookup multiuserlookup = field.Multiuserlookup;
+ Console.WriteLine("Get Multiselectlookup DisplayLabel" + multiuserlookup.DisplayLabel);
+ Console.WriteLine("Get Multiselectlookup LinkingModule" + multiuserlookup.LinkingModule);
+ Console.WriteLine("Get Multiselectlookup LookupAPIName" + multiuserlookup.LookupApiname);
+ Console.WriteLine("Get Multiselectlookup APIName" + multiuserlookup.APIName);
+ Console.WriteLine("Get Multiselectlookup Id" + multiuserlookup.Id);
+ Console.WriteLine("Get Multiselectlookup ConnectedModule" + multiuserlookup.ConnectedModule);
+ Console.WriteLine("Get Multiselectlookup ConnectedlookupAPIName" + multiuserlookup.ConnectedlookupApiname);
+ }
+ }
+
+ public static void PrintPickListValue(PickListValue pickListValue)
+ {
+ Console.WriteLine(" Fields PickListValue DisplayValue: " + pickListValue.DisplayValue);
+ Console.WriteLine(" Fields PickListValue SequenceNumber: " + pickListValue.SequenceNumber);
+ Console.WriteLine(" Fields PickListValue ExpectedDataType: " + pickListValue.ExpectedDataType);
+ Console.WriteLine(" Fields PickListValue ActualValue: " + pickListValue.ActualValue);
+ Console.WriteLine(" Fields PickListValue SysRefName: " + pickListValue.SysRefName);
+ Console.WriteLine(" Fields PickListValue Type: " + pickListValue.Type);
+ Console.WriteLine(" Fields PickListValue Id: " + pickListValue.Id);
+ foreach (Maps map in pickListValue.Maps)
+ {
+ Console.WriteLine(map);
+ List pickListValues = map.PickListValues;
+ if (pickListValues != null)
+ {
+ foreach (PickListValue plv in pickListValues)
+ {
+ Console.WriteLine(plv);
+ }
+ }
+ }
+ }
+
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL").Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ string moduleAPIName = "Leads";
+ GetLayouts_1(moduleAPIName);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/versions/3.0.0/Samples/MassDeleteTags1/GetStatus.cs b/versions/3.0.0/Samples/MassDeleteTags1/GetStatus.cs
new file mode 100644
index 0000000..7bf86ec
--- /dev/null
+++ b/versions/3.0.0/Samples/MassDeleteTags1/GetStatus.cs
@@ -0,0 +1,111 @@
+using System;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using Com.Zoho.Crm.API.MassDeleteTags;
+using Com.Zoho.Crm.API;
+using static Com.Zoho.Crm.API.MassDeleteTags.MassDeleteTagsOperations;
+using Com.Zoho.Crm.API.Util;
+using System.Collections.Generic;
+using System.Reflection;
+using Com.Zoho.Crm.API.Dc;
+using Com.Zoho.API.Authenticator;
+using Newtonsoft.Json;
+
+namespace Samples.MassDeleteTags1
+{
+ public class GetStatus
+ {
+ public static void GetStatus_1()
+ {
+ MassDeleteTagsOperations massDeleteTagsOperations = new MassDeleteTagsOperations();
+ ParameterMap paramInstance = new ParameterMap();
+ paramInstance.Add(GetStatusParam.JOB_ID, "3477022003");
+ APIResponse response = massDeleteTagsOperations.GetStatus(paramInstance);
+ if (response != null)
+ {
+ Console.WriteLine("Status Code: " + response.StatusCode);
+ if (response.IsExpected)
+ {
+ StatusResponseHandler responseHandler = response.Object;
+ if (responseHandler is StatusResponseWrapper)
+ {
+ StatusResponseWrapper statusResponseWrapper = (StatusResponseWrapper) responseHandler;
+ List statusActionResponse = statusResponseWrapper.MassDelete;
+ foreach (StatusActionResponse statusActionResponse1 in statusActionResponse)
+ {
+ if (statusActionResponse1 is MassDeleteDetails)
+ {
+ MassDeleteDetails massDeleteDetail = (MassDeleteDetails) statusActionResponse1;
+ Console.WriteLine("Status JobId: " + massDeleteDetail.JobId);
+ Console.WriteLine("Status TotalCount: " + massDeleteDetail.TotalCount);
+ Console.WriteLine("Status FailedCount: " + massDeleteDetail.FailedCount);
+ Console.WriteLine("Status DeletedCount: " + massDeleteDetail.DeletedCount);
+ Console.WriteLine("Job Status: " + massDeleteDetail.Status.Value);
+ }
+ else if (statusActionResponse1 is APIException)
+ {
+ APIException exception = (APIException)statusActionResponse1;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message);
+ }
+
+ }
+ }
+ else if (responseHandler is APIException)
+ {
+ APIException exception = (APIException)responseHandler;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL").Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ GetStatus_1();
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
+
diff --git a/versions/3.0.0/Samples/MassDeleteTags1/MassDeleteTags.cs b/versions/3.0.0/Samples/MassDeleteTags1/MassDeleteTags.cs
new file mode 100644
index 0000000..4ab7bd7
--- /dev/null
+++ b/versions/3.0.0/Samples/MassDeleteTags1/MassDeleteTags.cs
@@ -0,0 +1,107 @@
+using System;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using Com.Zoho.Crm.API.MassDeleteTags;
+using System.Collections.Generic;
+using Com.Zoho.Crm.API.Util;
+using System.Reflection;
+using Com.Zoho.Crm.API.Dc;
+using Com.Zoho.API.Authenticator;
+using Newtonsoft.Json;
+using Module = Com.Zoho.Crm.API.MassDeleteTags.Module;
+
+namespace Samples.MassDeleteTags1
+{
+ public class MassDeleteTags
+ {
+ public static void MassDeleteTags_1()
+ {
+ MassDeleteTagsOperations massDeleteTagsOperations = new MassDeleteTagsOperations();
+ BodyWrapper request = new BodyWrapper();
+ List massDelete = new List();
+ MassDelete massDelete1 = new MassDelete();
+ Module module = new Module();
+ module.APIName = "Leads";
+ module.Id = 347706002175l;
+ massDelete1.Module = module;
+ List tags = new List();
+ Tag tag = new Tag();
+ tag.Id = 34770689001l;
+ tags.Add(tag);
+ tag = new Tag();
+ tag.Id = 34770628007l;
+ tags.Add(tag);
+ massDelete1.Tags = tags;
+ massDelete.Add(massDelete1);
+ request.MassDelete = massDelete;
+ APIResponse response = massDeleteTagsOperations.MassDeleteTags(request);
+ if (response != null)
+ {
+ Console.WriteLine("Status Code: " + response.StatusCode);
+ if (response.IsExpected)
+ {
+ ActionResponse actionResponse = response.Object;
+ if (actionResponse is SuccessResponse)
+ {
+ SuccessResponse successresponse = (SuccessResponse)actionResponse;
+ Console.WriteLine("Status: " + successresponse.Status.Value);
+ Console.WriteLine("Code: " + successresponse.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in successresponse.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + successresponse.Message);
+ }
+ else if (actionResponse is APIException)
+ {
+ APIException exception = (APIException)actionResponse;
+ Console.WriteLine("Status: " + exception.Status.Value);
+ Console.WriteLine("Code: " + exception.Code.Value);
+ Console.WriteLine("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine(entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine("Message: " + exception.Message);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL").Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ MassDeleteTags_1();
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
+
diff --git a/versions/3.0.0/Samples/Notes/CreateNotes.cs b/versions/3.0.0/Samples/Notes/CreateNotes.cs
new file mode 100644
index 0000000..7c0938a
--- /dev/null
+++ b/versions/3.0.0/Samples/Notes/CreateNotes.cs
@@ -0,0 +1,131 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using Com.Zoho.API.Authenticator;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using APIException = Com.Zoho.Crm.API.Notes.APIException;
+using ActionHandler = Com.Zoho.Crm.API.Notes.ActionHandler;
+using ActionResponse = Com.Zoho.Crm.API.Notes.ActionResponse;
+using ActionWrapper = Com.Zoho.Crm.API.Notes.ActionWrapper;
+using BodyWrapper = Com.Zoho.Crm.API.Notes.BodyWrapper;
+using NotesOperations = Com.Zoho.Crm.API.Notes.NotesOperations;
+using SuccessResponse = Com.Zoho.Crm.API.Notes.SuccessResponse;
+using Com.Zoho.Crm.API.Util;
+using Com.Zoho.Crm.API.Dc;
+using Newtonsoft.Json;
+using Com.Zoho.Crm.API.Modules;
+
+namespace Samples.Notes
+{
+ public class CreateNotes
+ {
+ public static void CreateNotes_1()
+ {
+ NotesOperations notesOperations = new NotesOperations();
+ BodyWrapper bodyWrapper = new BodyWrapper();
+ List notes = new List();
+ for (int i = 1; i <= 5; i++)
+ {
+ Com.Zoho.Crm.API.Notes.Note note = new Com.Zoho.Crm.API.Notes.Note();
+ note.NoteTitle = "Contacted";
+ note.NoteContent = "Need to do further tracking";
+ Com.Zoho.Crm.API.Notes.ParentId parentRecord = new Com.Zoho.Crm.API.Notes.ParentId();
+ parentRecord.Id = 347703778003;
+ MinifiedModule module = new MinifiedModule();
+ module.APIName = "Leads";
+ module.Id = 347706002175;
+ parentRecord.Module = module;
+ note.ParentId = parentRecord;
+ notes.Add (note);
+ }
+ bodyWrapper.Data = notes;
+ APIResponse response = notesOperations.CreateNotes(bodyWrapper);
+ if (response != null)
+ {
+ Console.WriteLine ("Status Code: " + response.StatusCode);
+ if (response.IsExpected)
+ {
+ ActionHandler actionHandler = response.Object;
+ if (actionHandler is ActionWrapper)
+ {
+ ActionWrapper actionWrapper = (ActionWrapper) actionHandler;
+ List actionResponses = actionWrapper.Data;
+ foreach (ActionResponse actionResponse in actionResponses)
+ {
+ if (actionResponse is SuccessResponse)
+ {
+ SuccessResponse successResponse = (SuccessResponse) actionResponse;
+ Console.WriteLine ("Status: " + successResponse.Status.Value);
+ Console.WriteLine ("Code: " + successResponse.Code.Value);
+ Console.WriteLine ("Details: ");
+ foreach (KeyValuePair entry in successResponse.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine ("Message: " + successResponse.Message.Value);
+ }
+ else if (actionResponse is APIException)
+ {
+ APIException exception = (APIException) actionResponse;
+ Console.WriteLine ("Status: " + exception.Status.Value);
+ Console.WriteLine ("Code: " + exception.Code.Value);
+ Console.WriteLine ("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine ("Message: " + exception.Message.Value);
+ }
+ }
+ }
+ else if (actionHandler is APIException)
+ {
+ APIException exception = (APIException) actionHandler;
+ Console.WriteLine ("Status: " + exception.Status.Value);
+ Console.WriteLine ("Code: " + exception.Code.Value);
+ Console.WriteLine ("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine ("Message: " + exception.Message.Value);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL" ).Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ CreateNotes_1();
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/versions/3.0.0/Samples/Notes/DeleteNote.cs b/versions/3.0.0/Samples/Notes/DeleteNote.cs
new file mode 100644
index 0000000..19e49d3
--- /dev/null
+++ b/versions/3.0.0/Samples/Notes/DeleteNote.cs
@@ -0,0 +1,117 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using Com.Zoho.API.Authenticator;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using APIException = Com.Zoho.Crm.API.Notes.APIException;
+using ActionHandler = Com.Zoho.Crm.API.Notes.ActionHandler;
+using ActionResponse = Com.Zoho.Crm.API.Notes.ActionResponse;
+using ActionWrapper = Com.Zoho.Crm.API.Notes.ActionWrapper;
+using NotesOperations = Com.Zoho.Crm.API.Notes.NotesOperations;
+using SuccessResponse = Com.Zoho.Crm.API.Notes.SuccessResponse;
+using Com.Zoho.Crm.API.Util;
+using Com.Zoho.Crm.API.Dc;
+using Newtonsoft.Json;
+
+
+namespace Samples.Notes
+{
+ public class DeleteNote
+ {
+ public static void DeleteNote_1(long noteId)
+ {
+ NotesOperations notesOperations = new NotesOperations();
+ APIResponse response = notesOperations.DeleteNote(noteId);
+ if (response != null)
+ {
+ Console.WriteLine ("Status Code: " + response.StatusCode);
+ if (response.IsExpected)
+ {
+ ActionHandler actionHandler = response.Object;
+ if (actionHandler is ActionWrapper)
+ {
+ ActionWrapper actionWrapper = (ActionWrapper) actionHandler;
+ List actionResponses = actionWrapper.Data;
+ foreach (ActionResponse actionResponse in actionResponses)
+ {
+ if (actionResponse is SuccessResponse)
+ {
+ SuccessResponse successResponse = (SuccessResponse) actionResponse;
+ Console.WriteLine ("Status: " + successResponse.Status.Value);
+ Console.WriteLine ("Code: " + successResponse.Code.Value);
+ Console.WriteLine ("Details: ");
+ foreach (KeyValuePair entry in successResponse.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine ("Message: " + successResponse.Message.Value);
+ }
+ else if (actionResponse is APIException)
+ {
+ APIException exception = (APIException) actionResponse;
+ Console.WriteLine ("Status: " + exception.Status.Value);
+ Console.WriteLine ("Code: " + exception.Code.Value);
+ Console.WriteLine ("Details: ");
+ if (exception.Details != null)
+ {
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ }
+ Console.WriteLine ("Message: " + exception.Message.Value);
+ }
+ }
+ }
+ else if (actionHandler is APIException)
+ {
+ APIException exception = (APIException) actionHandler;
+ Console.WriteLine ("Status: " + exception.Status.Value);
+ Console.WriteLine ("Code: " + exception.Code.Value);
+ Console.WriteLine ("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine ("Message: " + exception.Message.Value);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL" ).Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ long noteId = 4402480012905;
+ DeleteNote_1(noteId);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/versions/3.0.0/Samples/Notes/DeleteNotes.cs b/versions/3.0.0/Samples/Notes/DeleteNotes.cs
new file mode 100644
index 0000000..9e233c9
--- /dev/null
+++ b/versions/3.0.0/Samples/Notes/DeleteNotes.cs
@@ -0,0 +1,121 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using Com.Zoho.API.Authenticator;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Com.Zoho.Crm.API;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using APIException = Com.Zoho.Crm.API.Notes.APIException;
+using ActionHandler = Com.Zoho.Crm.API.Notes.ActionHandler;
+using ActionResponse = Com.Zoho.Crm.API.Notes.ActionResponse;
+using ActionWrapper = Com.Zoho.Crm.API.Notes.ActionWrapper;
+using NotesOperations = Com.Zoho.Crm.API.Notes.NotesOperations;
+using SuccessResponse = Com.Zoho.Crm.API.Notes.SuccessResponse;
+using DeleteNotesParam = Com.Zoho.Crm.API.Notes.NotesOperations.DeleteNotesParam;
+using Com.Zoho.Crm.API.Util;
+using Com.Zoho.Crm.API.Dc;
+using Newtonsoft.Json;
+
+
+namespace Samples.Notes
+{
+ public class DeleteNotes
+ {
+ public static void DeleteNotes_1(List notesId)
+ {
+ NotesOperations notesOperations = new NotesOperations();
+ ParameterMap paramInstance = new ParameterMap();
+ paramInstance.Add(DeleteNotesParam.IDS, string.Join(",", notesId)); ;
+ APIResponse response = notesOperations.DeleteNotes(paramInstance);
+ if (response != null)
+ {
+ Console.WriteLine ("Status Code: " + response.StatusCode);
+ if (response.IsExpected)
+ {
+ ActionHandler actionHandler = response.Object;
+ if (actionHandler is ActionWrapper)
+ {
+ ActionWrapper actionWrapper = (ActionWrapper) actionHandler;
+ List actionResponses = actionWrapper.Data;
+ foreach (ActionResponse actionResponse in actionResponses)
+ {
+ if (actionResponse is SuccessResponse)
+ {
+ SuccessResponse successResponse = (SuccessResponse) actionResponse;
+ Console.WriteLine ("Status: " + successResponse.Status.Value);
+ Console.WriteLine ("Code: " + successResponse.Code.Value);
+ Console.WriteLine ("Details: ");
+ foreach (KeyValuePair entry in successResponse.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine ("Message: " + successResponse.Message.Value);
+ }
+ else if (actionResponse is APIException)
+ {
+ APIException exception = (APIException) actionResponse;
+ Console.WriteLine ("Status: " + exception.Status.Value);
+ Console.WriteLine ("Code: " + exception.Code.Value);
+ Console.WriteLine ("Details: ");
+ if (exception.Details != null)
+ {
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ }
+ Console.WriteLine ("Message: " + exception.Message.Value);
+ }
+ }
+ }
+ else if (actionHandler is APIException)
+ {
+ APIException exception = (APIException) actionHandler;
+ Console.WriteLine ("Status: " + exception.Status.Value);
+ Console.WriteLine ("Code: " + exception.Code.Value);
+ Console.WriteLine ("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine ("Message: " + exception.Message.Value);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL" ).Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ List notesId = new List() { "34770616153001", "34770616153002" } ;
+ DeleteNotes_1(notesId);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/versions/3.0.0/Samples/Notes/GetNote.cs b/versions/3.0.0/Samples/Notes/GetNote.cs
new file mode 100644
index 0000000..473bd10
--- /dev/null
+++ b/versions/3.0.0/Samples/Notes/GetNote.cs
@@ -0,0 +1,186 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using Com.Zoho.API.Authenticator;
+using HeaderMap = Com.Zoho.Crm.API.HeaderMap;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Com.Zoho.Crm.API;
+using Attachment = Com.Zoho.Crm.API.Attachments.Attachment;
+using ParentId = Com.Zoho.Crm.API.Attachments.ParentId;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using APIException = Com.Zoho.Crm.API.Notes.APIException;
+using NotesOperations = Com.Zoho.Crm.API.Notes.NotesOperations;
+using ResponseHandler = Com.Zoho.Crm.API.Notes.ResponseHandler;
+using ResponseWrapper = Com.Zoho.Crm.API.Notes.ResponseWrapper;
+using Com.Zoho.Crm.API.Util;
+using Com.Zoho.Crm.API.Dc;
+using Newtonsoft.Json;
+
+
+namespace Samples.Notes
+{
+ public class GetNote
+ {
+ public static void GetNote_1(long noteId)
+ {
+ NotesOperations notesOperations = new NotesOperations();
+ ParameterMap paramInstance = new ParameterMap();
+ HeaderMap headerInstance = new HeaderMap();
+ APIResponse response = notesOperations.GetNote(noteId, paramInstance, headerInstance);
+ if (response != null)
+ {
+ Console.WriteLine ("Status Code: " + response.StatusCode);
+ if (new List(){ 204, 304}.Contains(response.StatusCode))
+ {
+ Console.WriteLine (response.StatusCode == 204 ? "No Content" : "Not Modified");
+ return;
+ }
+ if (response.IsExpected)
+ {
+ ResponseHandler responseHandler = response.Object;
+ if (responseHandler is ResponseWrapper)
+ {
+ ResponseWrapper responseWrapper = (ResponseWrapper) responseHandler;
+ List notes = responseWrapper.Data;
+ foreach (Com.Zoho.Crm.API.Notes.Note note in notes)
+ {
+ Com.Zoho.Crm.API.Users.MinifiedUser owner = note.Owner;
+ if (owner != null)
+ {
+ Console.WriteLine ("Note Owner User-Name: " + owner.Name);
+ Console.WriteLine ("Note Owner User-ID: " + owner.Id);
+ Console.WriteLine ("Note Owner Email: " + owner.Email);
+ }
+ Console.WriteLine ("Note ModifiedTime: " + note.ModifiedTime);
+ List attachments = note.Attachments;
+ if (attachments != null)
+ {
+ foreach (Attachment attachment in attachments)
+ {
+ printAttachment(attachment);
+ }
+ }
+ Console.WriteLine ("Note CreatedTime: " + note.CreatedTime);
+ Com.Zoho.Crm.API.Notes.ParentId parentId = note.ParentId;
+ if (parentId != null)
+ {
+ Console.WriteLine ("Note parent record Name: " + parentId.Name);
+ Console.WriteLine ("Note parent record ID: " + parentId.Id);
+ }
+ Console.WriteLine ("Note Editable: " + note.Editable);
+ Console.WriteLine ("Note IsSharedToClient: " + note.IsSharedToClient);
+ Com.Zoho.Crm.API.Users.MinifiedUser modifiedBy = note.ModifiedBy;
+ if (modifiedBy != null)
+ {
+ Console.WriteLine ("Note Modified By User-Name: " + modifiedBy.Name);
+ Console.WriteLine ("Note Modified By User-ID: " + modifiedBy.Id);
+ Console.WriteLine ("Note Modified By User-Email: " + modifiedBy.Email);
+ }
+ Console.WriteLine ("Note Size: " + note.Size);
+ Console.WriteLine ("Note State: " + note.State);
+ Console.WriteLine ("Note VoiceNote: " + note.VoiceNote);
+ Console.WriteLine ("Note Id: " + note.Id);
+ Com.Zoho.Crm.API.Users.MinifiedUser createdBy = note.CreatedBy;
+ if (createdBy != null)
+ {
+ Console.WriteLine ("Note Created By User-Name: " + createdBy.Name);
+ Console.WriteLine ("Note Created By User-ID: " + createdBy.Id);
+ Console.WriteLine ("Note Created By User-Email: " + createdBy.Email);
+ }
+ Console.WriteLine ("Note NoteTitle: " + note.NoteTitle);
+ Console.WriteLine ("Note NoteContent: " + note.NoteContent);
+ }
+ }
+ else if (responseHandler is APIException)
+ {
+ APIException exception = (APIException) responseHandler;
+ Console.WriteLine ("Status: " + exception.Status.Value);
+ Console.WriteLine ("Code: " + exception.Code.Value);
+ Console.WriteLine ("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine ("Message: " + exception.Message.Value);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+ private static void printAttachment(Attachment attachment)
+ {
+ Com.Zoho.Crm.API.Users.MinifiedUser owner = attachment.Owner;
+ if (owner != null)
+ {
+ Console.WriteLine ("Note Attachment Owner User-Name: " + owner.Name);
+ Console.WriteLine ("Note Attachment Owner User-ID: " + owner.Id);
+ Console.WriteLine ("Note Attachment Owner User-Email: " + owner.Email);
+ }
+ Console.WriteLine ("Note Attachment Modified Time: " + attachment.ModifiedTime);
+ Console.WriteLine ("Note Attachment File Name: " + attachment.FileName);
+ Console.WriteLine ("Note Attachment Created Time: " + attachment.CreatedTime);
+ Console.WriteLine ("Note Attachment File Size: " + attachment.Size);
+ ParentId parentId = attachment.ParentId;
+ if (parentId != null)
+ {
+ Console.WriteLine ("Note Attachment parent record Name: " + parentId.Name);
+ Console.WriteLine ("Note Attachment parent record ID: " + parentId.Id);
+ }
+ Console.WriteLine ("Note Attachment is Editable: " + attachment.Editable);
+ Console.WriteLine ("Note Attachment is SharingPermission: " + attachment.SharingPermission);
+ Console.WriteLine ("Note Attachment File ID: " + attachment.FileId);
+ Console.WriteLine ("Note Attachment File Type: " + attachment.Type);
+ Console.WriteLine ("Note Attachment seModule: " + attachment.SeModule);
+ Com.Zoho.Crm.API.Users.MinifiedUser modifiedBy = attachment.ModifiedBy;
+ if (modifiedBy != null)
+ {
+ Console.WriteLine ("Note Attachment Modified By User-Name: " + modifiedBy.Name);
+ Console.WriteLine ("Note Attachment Modified By User-ID: " + modifiedBy.Id);
+ Console.WriteLine ("Note Attachment Modified By User-Email: " + modifiedBy.Email);
+ }
+ Console.WriteLine ("Note Attachment State: " + attachment.State);
+ Console.WriteLine ("Note Attachment ID: " + attachment.Id);
+ Com.Zoho.Crm.API.Users.MinifiedUser createdBy = attachment.CreatedBy;
+ if (createdBy != null)
+ {
+ Console.WriteLine ("Note Attachment Created By User-Name: " + createdBy.Name);
+ Console.WriteLine ("Note Attachment Created By User-ID: " + createdBy.Id);
+ Console.WriteLine ("Note Attachment Created By User-Email: " + createdBy.Email);
+ }
+ Console.WriteLine ("Note Attachment LinkUrl: " + attachment.LinkUrl);
+ }
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL" ).Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ long noteId = 34770616153005;
+ GetNote_1(noteId);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/versions/3.0.0/Samples/Notes/GetNotes.cs b/versions/3.0.0/Samples/Notes/GetNotes.cs
new file mode 100644
index 0000000..82c09a7
--- /dev/null
+++ b/versions/3.0.0/Samples/Notes/GetNotes.cs
@@ -0,0 +1,215 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using Com.Zoho.API.Authenticator;
+using HeaderMap = Com.Zoho.Crm.API.HeaderMap;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Com.Zoho.Crm.API;
+using Attachment = Com.Zoho.Crm.API.Attachments.Attachment;
+using ParentId = Com.Zoho.Crm.API.Attachments.ParentId;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using APIException = Com.Zoho.Crm.API.Notes.APIException;
+using Info = Com.Zoho.Crm.API.Notes.Info;
+using NotesOperations = Com.Zoho.Crm.API.Notes.NotesOperations;
+using ResponseHandler = Com.Zoho.Crm.API.Notes.ResponseHandler;
+using ResponseWrapper = Com.Zoho.Crm.API.Notes.ResponseWrapper;
+using GetNotesHeader = Com.Zoho.Crm.API.Notes.NotesOperations.GetNotesHeader;
+using GetNotesParam = Com.Zoho.Crm.API.Notes.NotesOperations.GetNotesParam;
+using Com.Zoho.Crm.API.Util;
+using Com.Zoho.Crm.API.Dc;
+using Newtonsoft.Json;
+
+
+namespace Samples.Notes
+{
+ public class GetNotes
+ {
+ public static void GetNotes_1()
+ {
+ NotesOperations notesOperations = new NotesOperations();
+ ParameterMap paramInstance = new ParameterMap();
+ paramInstance.Add (GetNotesParam.PAGE, "1");
+ paramInstance.Add (GetNotesParam.PER_PAGE, "10");
+ paramInstance.Add (GetNotesParam.FIELDS, "id");
+ //paramInstance.Add (new Param("ids", null), "3477008207");
+ HeaderMap headerInstance = new HeaderMap();
+ DateTimeOffset startdatetime = new DateTimeOffset(new DateTime(2020, 05, 15, 12, 0, 0, DateTimeKind.Local));
+ headerInstance.Add(GetNotesHeader.IF_MODIFIED_SINCE, startdatetime);
+ APIResponse response = notesOperations.GetNotes(paramInstance, headerInstance);
+ if (response != null)
+ {
+ Console.WriteLine ("Status Code: " + response.StatusCode);
+ if (new List(){ 204, 304}.Contains(response.StatusCode))
+ {
+ Console.WriteLine (response.StatusCode == 204 ? "No Content" : "Not Modified");
+ return;
+ }
+ if (response.IsExpected)
+ {
+ ResponseHandler responseHandler = response.Object;
+ if (responseHandler is ResponseWrapper)
+ {
+ ResponseWrapper responseWrapper = (ResponseWrapper) responseHandler;
+ List notes = responseWrapper.Data;
+ foreach (Com.Zoho.Crm.API.Notes.Note note in notes)
+ {
+ Com.Zoho.Crm.API.Users.MinifiedUser owner = note.Owner;
+ if (owner != null)
+ {
+ Console.WriteLine ("Note Owner User-Name: " + owner.Name);
+ Console.WriteLine ("Note Owner User-ID: " + owner.Id);
+ Console.WriteLine ("Note Owner Email: " + owner.Email);
+ }
+ Console.WriteLine ("Note ModifiedTime: " + note.ModifiedTime);
+ List attachments = note.Attachments;
+ if (attachments != null)
+ {
+ foreach (Attachment attachment in attachments)
+ {
+ printAttachment(attachment);
+ }
+ }
+ Console.WriteLine ("Note CreatedTime: " + note.CreatedTime);
+ Com.Zoho.Crm.API.Notes.ParentId parentId = note.ParentId;
+ if (parentId != null)
+ {
+ Console.WriteLine ("Note parent record Name: " + parentId.Name);
+ Console.WriteLine ("Note parent record ID: " + parentId.Id);
+ }
+ Console.WriteLine ("Note Editable: " + note.Editable);
+ Console.WriteLine ("Note SharingPermission: " + note.SharingPermission);
+ Console.WriteLine ("Note IsSharedToClient: " + note.IsSharedToClient);
+ Com.Zoho.Crm.API.Users.MinifiedUser modifiedBy = note.ModifiedBy;
+ if (modifiedBy != null)
+ {
+ Console.WriteLine ("Note Modified By User-Name: " + modifiedBy.Name);
+ Console.WriteLine ("Note Modified By User-ID: " + modifiedBy.Id);
+ Console.WriteLine ("Note Modified By User-Email: " + modifiedBy.Email);
+ }
+ Console.WriteLine ("Note Size: " + note.Size);
+ Console.WriteLine ("Note State: " + note.State);
+ Console.WriteLine ("Note VoiceNote: " + note.VoiceNote);
+ Console.WriteLine ("Note Id: " + note.Id);
+ Com.Zoho.Crm.API.Users.MinifiedUser createdBy = note.CreatedBy;
+ if (createdBy != null)
+ {
+ Console.WriteLine ("Note Created By User-Name: " + createdBy.Name);
+ Console.WriteLine ("Note Created By User-ID: " + createdBy.Id);
+ Console.WriteLine ("Note Created By User-Email: " + createdBy.Email);
+ }
+ Console.WriteLine ("Note NoteTitle: " + note.NoteTitle);
+ Console.WriteLine ("Note NoteContent: " + note.NoteContent);
+ }
+ Info info = responseWrapper.Info;
+ if (info != null)
+ {
+ if (info.PerPage != null)
+ {
+ Console.WriteLine ("Note Info PerPage: " + info.PerPage);
+ }
+ if (info.Count != null)
+ {
+ Console.WriteLine ("Note Info Count: " + info.Count);
+ }
+ if (info.Page != null)
+ {
+ Console.WriteLine ("Note Info Page: " + info.Page);
+ }
+ if (info.MoreRecords != null)
+ {
+ Console.WriteLine ("Note Info MoreRecords: " + info.MoreRecords);
+ }
+ }
+ }
+ else if (responseHandler is APIException)
+ {
+ APIException exception = (APIException) responseHandler;
+ Console.WriteLine ("Status: " + exception.Status.Value);
+ Console.WriteLine ("Code: " + exception.Code.Value);
+ Console.WriteLine ("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine ("Message: " + exception.Message.Value);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+ private static void printAttachment(Attachment attachment)
+ {
+ Com.Zoho.Crm.API.Users.MinifiedUser owner = attachment.Owner;
+ if (owner != null)
+ {
+ Console.WriteLine ("Note Attachment Owner User-Name: " + owner.Name);
+ Console.WriteLine ("Note Attachment Owner User-ID: " + owner.Id);
+ Console.WriteLine ("Note Attachment Owner User-Email: " + owner.Email);
+ }
+ Console.WriteLine ("Note Attachment Modified Time: " + attachment.ModifiedTime);
+ Console.WriteLine ("Note Attachment File Name: " + attachment.FileName);
+ Console.WriteLine ("Note Attachment Created Time: " + attachment.CreatedTime);
+ Console.WriteLine ("Note Attachment File Size: " + attachment.Size);
+ ParentId parentId = attachment.ParentId;
+ if (parentId != null)
+ {
+ Console.WriteLine ("Note Attachment parent record Name: " + parentId.Name);
+ Console.WriteLine ("Note Attachment parent record ID: " + parentId.Id);
+ }
+ Console.WriteLine ("Note Attachment is Editable: " + attachment.Editable);
+ Console.WriteLine ("Note Attachment is SharingPermission: " + attachment.SharingPermission);
+ Console.WriteLine ("Note Attachment File ID: " + attachment.FileId);
+ Console.WriteLine ("Note Attachment File Type: " + attachment.Type);
+ Console.WriteLine ("Note Attachment seModule: " + attachment.SeModule);
+ Com.Zoho.Crm.API.Users.MinifiedUser modifiedBy = attachment.ModifiedBy;
+ if (modifiedBy != null)
+ {
+ Console.WriteLine ("Note Attachment Modified By User-Name: " + modifiedBy.Name);
+ Console.WriteLine ("Note Attachment Modified By User-ID: " + modifiedBy.Id);
+ Console.WriteLine ("Note Attachment Modified By User-Email: " + modifiedBy.Email);
+ }
+ Console.WriteLine ("Note Attachment State: " + attachment.State);
+ Console.WriteLine ("Note Attachment ID: " + attachment.Id);
+ Com.Zoho.Crm.API.Users.MinifiedUser createdBy = attachment.CreatedBy;
+ if (createdBy != null)
+ {
+ Console.WriteLine ("Note Attachment Created By User-Name: " + createdBy.Name);
+ Console.WriteLine ("Note Attachment Created By User-ID: " + createdBy.Id);
+ Console.WriteLine ("Note Attachment Created By User-Email: " + createdBy.Email);
+ }
+ Console.WriteLine ("Note Attachment LinkUrl: " + attachment.LinkUrl);
+ }
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL" ).Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ GetNotes_1();
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/versions/3.0.0/Samples/Notes/UpdateNote.cs b/versions/3.0.0/Samples/Notes/UpdateNote.cs
new file mode 100644
index 0000000..748d16f
--- /dev/null
+++ b/versions/3.0.0/Samples/Notes/UpdateNote.cs
@@ -0,0 +1,132 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using Com.Zoho.API.Authenticator;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using APIException = Com.Zoho.Crm.API.Notes.APIException;
+using ActionHandler = Com.Zoho.Crm.API.Notes.ActionHandler;
+using ActionResponse = Com.Zoho.Crm.API.Notes.ActionResponse;
+using ActionWrapper = Com.Zoho.Crm.API.Notes.ActionWrapper;
+using BodyWrapper = Com.Zoho.Crm.API.Notes.BodyWrapper;
+using NotesOperations = Com.Zoho.Crm.API.Notes.NotesOperations;
+using SuccessResponse = Com.Zoho.Crm.API.Notes.SuccessResponse;
+using Com.Zoho.Crm.API.Util;
+using Com.Zoho.Crm.API.Dc;
+using Newtonsoft.Json;
+using Com.Zoho.Crm.API.Modules;
+
+namespace Samples.Notes
+{
+ public class UpdateNote
+ {
+ public static void UpdateNote_1(long noteId)
+ {
+ NotesOperations notesOperations = new NotesOperations();
+ BodyWrapper bodyWrapper = new BodyWrapper();
+ List notes = new List();
+ Com.Zoho.Crm.API.Notes.Note note = new Com.Zoho.Crm.API.Notes.Note();
+ note.NoteTitle = "Contacted12";
+ note.NoteContent = "Need to do further tracking12";
+ Com.Zoho.Crm.API.Notes.ParentId parentRecord = new Com.Zoho.Crm.API.Notes.ParentId();
+ parentRecord.Id = 34770617255001;
+ MinifiedModule module = new MinifiedModule();
+ module.APIName = "Leads";
+ module.Id = 347706000002175;
+ parentRecord.Module = module;
+ note.ParentId = parentRecord;
+ notes.Add (note);
+ bodyWrapper.Data = notes;
+ APIResponse response = notesOperations.UpdateNote(noteId, bodyWrapper);
+ if (response != null)
+ {
+ Console.WriteLine ("Status Code: " + response.StatusCode);
+ if (response.IsExpected)
+ {
+ ActionHandler actionHandler = response.Object;
+ if (actionHandler is ActionWrapper)
+ {
+ ActionWrapper actionWrapper = (ActionWrapper) actionHandler;
+ List actionResponses = actionWrapper.Data;
+ foreach (ActionResponse actionResponse in actionResponses)
+ {
+ if (actionResponse is SuccessResponse)
+ {
+ SuccessResponse successResponse = (SuccessResponse) actionResponse;
+ Console.WriteLine ("Status: " + successResponse.Status.Value);
+ Console.WriteLine ("Code: " + successResponse.Code.Value);
+ Console.WriteLine ("Details: ");
+ foreach (KeyValuePair entry in successResponse.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine ("Message: " + successResponse.Message.Value);
+ }
+ else if (actionResponse is APIException)
+ {
+ APIException exception = (APIException) actionResponse;
+ Console.WriteLine ("Status: " + exception.Status.Value);
+ Console.WriteLine ("Code: " + exception.Code.Value);
+ Console.WriteLine ("Details: ");
+ if (exception.Details != null)
+ {
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ }
+ Console.WriteLine ("Message: " + exception.Message.Value);
+ }
+ }
+ }
+ else if (actionHandler is APIException)
+ {
+ APIException exception = (APIException) actionHandler;
+ Console.WriteLine ("Status: " + exception.Status.Value);
+ Console.WriteLine ("Code: " + exception.Code.Value);
+ Console.WriteLine ("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine ("Message: " + exception.Message.Value);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL" ).Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ long noteId = 34770616153005;
+ UpdateNote_1(noteId);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/versions/3.0.0/Samples/PickListValues/GetPickListValues.cs b/versions/3.0.0/Samples/PickListValues/GetPickListValues.cs
new file mode 100644
index 0000000..a52411f
--- /dev/null
+++ b/versions/3.0.0/Samples/PickListValues/GetPickListValues.cs
@@ -0,0 +1,107 @@
+using System;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using Com.Zoho.Crm.API.PickListValues;
+using Com.Zoho.Crm.API.Util;
+
+namespace Samples.PickListValues
+{
+ public class GetPickListValues
+ {
+ public static void GetPickListValues_1(long fieldId, string moduleAPIName)
+ {
+ PickListValuesOperations pickListValuesOperations = new PickListValuesOperations(fieldId, moduleAPIName);
+ APIResponse response = pickListValuesOperations.GetPickListValues();
+ if (response != null)
+ {
+ Console.WriteLine ("Status Code: " + response.StatusCode);
+ if (response.StatusCode() == 204)
+ {
+ Console.WriteLine ("No Content");
+ return;
+ }
+ if (response.isExpected())
+ {
+ ResponseHandler responseHandler = response.Object();
+ if (responseHandler instanceof ResponseWrapper)
+ {
+ ResponseWrapper responseWrapper = (ResponseWrapper) responseHandler;
+ List pickListValues = responseWrapper.PickListValues();
+ if(pickListValues != null)
+ {
+ for(PickListValues pickListValue : pickListValues)
+ {
+ Console.WriteLine ("PickListValues SequenceNumber : " + pickListValue.SequenceNumber);
+ Console.WriteLine ("PickListValues DisplayValue : " + pickListValue.DisplayValue);
+ Console.WriteLine ("PickListValues ReferenceValue : " + pickListValue.ReferenceValue);
+ Console.WriteLine ("PickListValues ColourCode( : " + pickListValue.ColourCode);
+ Console.WriteLine ("PickListValues ActualValue : " + pickListValue.ActualValue);
+ Console.WriteLine ("PickListValues Id : " + pickListValue.Id);
+ Console.WriteLine ("PickListValues Type : " + pickListValue.Type);
+ List layoutAssociations = pickListValue.LayoutAssociations();
+ if(layoutAssociations != null)
+ {
+ for(LayoutAssociation layoutAssociation : layoutAssociations)
+ {
+ Console.WriteLine ("PickListValues LayoutAssociation Id : " + layoutAssociation.Id);
+ Console.WriteLine ("PickListValues LayoutAssociation Name : " + layoutAssociation.Name);
+ Console.WriteLine ("PickListValues LayoutAssociation APIName : " + layoutAssociation.APIName);
+ }
+ }
+ }
+ }
+ }
+ else if (responseHandler instanceof APIException)
+ {
+ APIException exception = (APIException) responseHandler;
+ Console.WriteLine ("Status: " + exception.Status.Value);
+ Console.WriteLine ("Code: " + exception.Code.Value);
+ Console.WriteLine ("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine ("Message: " + exception.Message.Value);
+ }
+ }
+ else if (response.StatusCode != 204)
+ {
+ Model responseObject = response.Model;
+ Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL" ).Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ string moduleAPIName = "Leads";
+ long fieldId = 3477061000000002619;
+ GetPickListValues_1(fieldId, moduleAPIName);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
+
diff --git a/versions/3.0.0/Samples/Record/CloneRecord.cs b/versions/3.0.0/Samples/Record/CloneRecord.cs
new file mode 100644
index 0000000..6be6c77
--- /dev/null
+++ b/versions/3.0.0/Samples/Record/CloneRecord.cs
@@ -0,0 +1,111 @@
+using System;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using Com.Zoho.Crm.API.Record;
+using Com.Zoho.Crm.API.Util;
+using System.Collections.Generic;
+using System.Reflection;
+using Com.Zoho.Crm.API.Dc;
+using Com.Zoho.API.Authenticator;
+using Newtonsoft.Json;
+
+namespace Samples.Record
+{
+ public class CloneRecord
+ {
+ public static void CloneRecord_1(string moduleAPIName, long recordId)
+ {
+ RecordOperations recordOperations = new RecordOperations(moduleAPIName);
+ APIResponse response = recordOperations.CloneRecord(recordId);
+ if (response != null)
+ {
+ Console.WriteLine ("Status Code: " + response.StatusCode);
+ if (response.IsExpected)
+ {
+ ActionHandler actionHandler = response.Object;
+ if (actionHandler is ActionWrapper)
+ {
+ ActionWrapper actionWrapper = (ActionWrapper) actionHandler;
+ List actionResponses = actionWrapper.Data;
+ foreach (ActionResponse actionResponse in actionResponses)
+ {
+ if (actionResponse is SuccessResponse)
+ {
+ SuccessResponse successResponse = (SuccessResponse) actionResponse;
+ Console.WriteLine ("Status: " + successResponse.Status.Value);
+ Console.WriteLine ("Code: " + successResponse.Code.Value);
+ Console.WriteLine ("Details: ");
+ foreach (KeyValuePair entry in successResponse.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine ("Message: " + successResponse.Message.Value);
+ }
+ else if (actionResponse is APIException)
+ {
+ APIException exception = (APIException) actionResponse;
+ Console.WriteLine ("Status: " + exception.Status.Value);
+ Console.WriteLine ("Code: " + exception.Code.Value);
+ Console.WriteLine ("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine ("Message: " + exception.Message.Value);
+ }
+ }
+ }
+ else if (actionHandler is APIException)
+ {
+ APIException exception = (APIException) actionHandler;
+ Console.WriteLine ("Status: " + exception.Status.Value);
+ Console.WriteLine ("Code: " + exception.Code.Value);
+ Console.WriteLine ("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine ("Message: " + exception.Message.Value);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL" ).Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ string moduleAPIName = "Leads";
+ long recordId = 44024000774074l;
+ CloneRecord_1(moduleAPIName, recordId);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
+
diff --git a/versions/3.0.0/Samples/Record/CreateRecords/Accounts.cs b/versions/3.0.0/Samples/Record/CreateRecords/Accounts.cs
new file mode 100644
index 0000000..4956199
--- /dev/null
+++ b/versions/3.0.0/Samples/Record/CreateRecords/Accounts.cs
@@ -0,0 +1,221 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using Com.Zoho.API.Authenticator;
+using HeaderMap = Com.Zoho.Crm.API.HeaderMap;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using APIException = Com.Zoho.Crm.API.Record.APIException;
+using ActionHandler = Com.Zoho.Crm.API.Record.ActionHandler;
+using ActionResponse = Com.Zoho.Crm.API.Record.ActionResponse;
+using ActionWrapper = Com.Zoho.Crm.API.Record.ActionWrapper;
+using BodyWrapper = Com.Zoho.Crm.API.Record.BodyWrapper;
+using Consent = Com.Zoho.Crm.API.Record.Consent;
+using FileDetails = Com.Zoho.Crm.API.Record.FileDetails;
+using RecordOperations = Com.Zoho.Crm.API.Record.RecordOperations;
+using SuccessResponse = Com.Zoho.Crm.API.Record.SuccessResponse;
+using Tag = Com.Zoho.Crm.API.Tags.Tag;
+using Com.Zoho.Crm.API.Util;
+using Com.Zoho.Crm.API.Dc;
+using Newtonsoft.Json;
+
+namespace Samples.Record.CreateRecords
+{
+ public class Accounts
+ {
+ public static void CreateAccounts_1(string module)
+ {
+ RecordOperations recordOperations = new RecordOperations(module);
+ BodyWrapper bodyWrapper = new BodyWrapper();
+ List records = new List();
+ Com.Zoho.Crm.API.Record.Record record1 = new Com.Zoho.Crm.API.Record.Record();
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.ACCOUNT_NAME, "new Account");
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.RATING, new Choice("Active"));
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.PHONE, "111111");
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.ACCOUNT_SITE, "www.account.com");
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.FAX, "fax");
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.WEBSITE, null);
+ Com.Zoho.Crm.API.Record.Record parentAccount = new Com.Zoho.Crm.API.Record.Record();
+ parentAccount.Id = 4230432933L;
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.PARENT_ACCOUNT, parentAccount);
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.ACCOUNT_NUMBER, 121121L);
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.ACCOUNT_TYPE, new Choice("Customer"));
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.ANNUAL_REVENUE, 2121.1);
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.EMPLOYEES, 100);
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.INDUSTRY, new Choice("Technology"));
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.SIC_CODE, null);
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.OWNERSHIP, new Choice("Private"));
+ // Address info of Account
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.BILLING_CITY, "city");
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.BILLING_CODE, "12345");
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.BILLING_COUNTRY, "country");
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.BILLING_STATE, "state");
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.BILLING_STREET, "street");
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.SHIPPING_CITY, "shipping city");
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.SHIPPING_CODE, "shipping code");
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.SHIPPING_COUNTRY, "shipping country");
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.SHIPPING_STATE, "shipping state");
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.SHIPPING_STREET, "shipping street");
+ //
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Accounts.DESCRIPTION, "description");
+ // Used when GDPR is enabled
+ Consent dataConsent = new Consent();
+ dataConsent.ConsentRemarks = "Approved.";
+ dataConsent.ConsentThrough = "Email";
+ dataConsent.ContactThroughEmail = true;
+ dataConsent.ContactThroughSocial = false;
+ dataConsent.ContactThroughPhone = true;
+ dataConsent.ContactThroughSurvey = true;
+ dataConsent.ConsentDate = new DateTime(2023, 10, 11).Date;
+ dataConsent.DataProcessingBasis = "Obtained";
+ record1.AddKeyValue("Data_Processing_Basis_Details", dataConsent);
+ // for MultiSelectLookUp/custom MultiSelectLookUp
+ List Multirecords = new List();
+ Com.Zoho.Crm.API.Record.Record record = new Com.Zoho.Crm.API.Record.Record();
+ Com.Zoho.Crm.API.Record.Record linkingRecord = new Com.Zoho.Crm.API.Record.Record();
+ record.AddKeyValue("id", 440248884001L);
+ linkingRecord.AddKeyValue("Msl", record);
+ Multirecords.Add (linkingRecord);
+ record1.AddKeyValue("Msl", Multirecords);
+ // for Custom Fields
+ record1.AddKeyValue("External", "Value12345");
+ record1.AddKeyValue("Custom_field", "Value");
+ record1.AddKeyValue("Date_Time_2", new DateTimeOffset(new DateTime(2020, 05, 15, 12, 0, 0, DateTimeKind.Local)));
+ record1.AddKeyValue("Date_1", new DateTime(2021, 1, 13).Date);
+ record1.AddKeyValue("Subject", "AutomatedSDK");
+ record1.AddKeyValue("Product_Name", "AutomatedSDK");
+ List fileDetails = new List();
+ FileDetails fileDetail1 = new FileDetails();
+ fileDetail1.FileIdS = "ae9c7cefa418aec1d6a5cc2d9ab35c32a6ae23db0bd44183d280";
+ fileDetails.Add (fileDetail1);
+ FileDetails fileDetail2 = new FileDetails();
+ fileDetail2.FileIdS = "ae9c7cefa418aec1d6a5cc2d9ab35c32e0ca878a934519e6cdb2";
+ fileDetails.Add (fileDetail2);
+ record1.AddKeyValue("File_Upload", fileDetails);
+ // for Custom User LookUp
+ Com.Zoho.Crm.API.Users.MinifiedUser user = new Com.Zoho.Crm.API.Users.MinifiedUser();
+ user.Id = 440248254001L;
+ record1.AddKeyValue("User_1", user);
+ // for Custom LookUp
+ Com.Zoho.Crm.API.Record.Record data = new Com.Zoho.Crm.API.Record.Record();
+ data.Id = 440248774074L;
+ record1.AddKeyValue("Lookup_2", data);
+ // for Custom pickList
+ record1.AddKeyValue("pick", new Choice("true"));
+ // for Custom MultiSelect
+ record1.AddKeyValue("Multiselect", new List>() { new Choice("Option 1"), new Choice("Option 2") });
+ // Subform sample code
+ List subformList = new List();
+ Com.Zoho.Crm.API.Record.Record subform = new Com.Zoho.Crm.API.Record.Record();
+ subform.AddKeyValue("customfield", "customvalue");
+ Com.Zoho.Crm.API.Users.MinifiedUser user1 = new Com.Zoho.Crm.API.Users.MinifiedUser();
+ user1.Id = 440248254001L;
+ subform.AddKeyValue("Userfield", user1);
+ subformList.Add (subform);
+ record1.AddKeyValue("Subform_2", subformList);
+ List tagList = new List();
+ Tag tag = new Tag();
+ tag.Name = "Testtask";
+ tagList.Add (tag);
+ record1.Tag = tagList;
+ // Add Record instance to the list
+ records.Add (record1);
+ bodyWrapper.Data = records;
+ List trigger = new List();
+ trigger.Add ("approval");
+ trigger.Add ("workflow");
+ trigger.Add ("blueprint");
+ bodyWrapper.Trigger = trigger;
+ bodyWrapper.LarId = "3477061087515";
+ HeaderMap headerInstance = new HeaderMap();
+ // headerInstance.Add (CreateRecordsHeader.X_EXTERNAL, "Quotes.Quoted_Items.Product_Name.Products_External");
+ APIResponse response = recordOperations.CreateRecords(bodyWrapper, headerInstance);
+ if (response != null)
+ {
+ Console.WriteLine ("Status Code: " + response.StatusCode);
+ if (response.IsExpected)
+ {
+ ActionHandler actionHandler = response.Object;
+ if (actionHandler is ActionWrapper)
+ {
+ ActionWrapper actionWrapper = (ActionWrapper) actionHandler;
+ List actionResponses = actionWrapper.Data;
+ foreach (ActionResponse actionResponse in actionResponses)
+ {
+ if (actionResponse is SuccessResponse)
+ {
+ SuccessResponse successResponse = (SuccessResponse) actionResponse;
+ Console.WriteLine ("Status: " + successResponse.Status.Value);
+ Console.WriteLine ("Code: " + successResponse.Code.Value);
+ Console.WriteLine ("Details: ");
+ foreach (KeyValuePair entry in successResponse.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine ("Message: " + successResponse.Message.Value);
+ }
+ else if (actionResponse is APIException)
+ {
+ APIException exception = (APIException) actionResponse;
+ Console.WriteLine ("Status: " + exception.Status.Value);
+ Console.WriteLine ("Code: " + exception.Code.Value);
+ Console.WriteLine ("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine ("Message: " + exception.Message.Value);
+ }
+ }
+ }
+ else if (actionHandler is APIException)
+ {
+ APIException exception = (APIException) actionHandler;
+ Console.WriteLine ("Status: " + exception.Status.Value);
+ Console.WriteLine ("Code: " + exception.Code.Value);
+ Console.WriteLine ("Details: ");
+ foreach (KeyValuePair entry in exception.Details)
+ {
+ Console.WriteLine (entry.Key + ": " + entry.Value);
+ }
+ Console.WriteLine ("Message: " + exception.Message.Value);
+ }
+ }
+ else
+ {
+ Model responseObject = response.Model;
+ Type type = responseObject.GetType();
+ Console.WriteLine("Type is : {0}", type.Name);
+ PropertyInfo[] props = type.GetProperties();
+ Console.WriteLine("Properties (N = {0}) :", props.Length);
+ foreach (var prop in props)
+ {
+ if (prop.GetIndexParameters().Length == 0)
+ {
+ Console.WriteLine("{0} ({1}) in {2}", prop.Name, prop.PropertyType.Name, prop.GetValue(responseObject));
+ }
+ else
+ {
+ Console.WriteLine("{0} ({1}) in ", prop.Name, prop.PropertyType.Name);
+ }
+ }
+ }
+ }
+ }
+ public static void Call()
+ {
+ try
+ {
+ Environment environment = USDataCenter.PRODUCTION;
+ IToken token = new OAuthToken.Builder().ClientId("Client_Id").ClientSecret("Client_Secret").RefreshToken("Refresh_Token").RedirectURL("Redirect_URL" ).Build();
+ new Initializer.Builder().Environment(environment).Token(token).Initialize();
+ string moduleAPIName = "Accounts";
+ CreateAccounts_1(moduleAPIName);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(e));
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/versions/3.0.0/Samples/Record/CreateRecords/Calls.cs b/versions/3.0.0/Samples/Record/CreateRecords/Calls.cs
new file mode 100644
index 0000000..91f86cd
--- /dev/null
+++ b/versions/3.0.0/Samples/Record/CreateRecords/Calls.cs
@@ -0,0 +1,229 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using Com.Zoho.API.Authenticator;
+using HeaderMap = Com.Zoho.Crm.API.HeaderMap;
+using Initializer = Com.Zoho.Crm.API.Initializer;
+using Environment = Com.Zoho.Crm.API.Dc.DataCenter.Environment;
+using APIException = Com.Zoho.Crm.API.Record.APIException;
+using ActionHandler = Com.Zoho.Crm.API.Record.ActionHandler;
+using ActionResponse = Com.Zoho.Crm.API.Record.ActionResponse;
+using ActionWrapper = Com.Zoho.Crm.API.Record.ActionWrapper;
+using BodyWrapper = Com.Zoho.Crm.API.Record.BodyWrapper;
+using Consent = Com.Zoho.Crm.API.Record.Consent;
+using FileDetails = Com.Zoho.Crm.API.Record.FileDetails;
+using RecordOperations = Com.Zoho.Crm.API.Record.RecordOperations;
+using SuccessResponse = Com.Zoho.Crm.API.Record.SuccessResponse;
+using Tag = Com.Zoho.Crm.API.Tags.Tag;
+using Com.Zoho.Crm.API.Util;
+using Com.Zoho.Crm.API.Dc;
+using Newtonsoft.Json;
+
+
+namespace Samples.Record.CreateRecords
+{
+ public class Calls
+ {
+ public static void CreateCall_1(string moduleAPIName)
+ {
+ RecordOperations recordOperations = new RecordOperations(moduleAPIName);
+ BodyWrapper bodyWrapper = new BodyWrapper();
+ List records = new List();
+ Com.Zoho.Crm.API.Record.Record record1 = new Com.Zoho.Crm.API.Record.Record();
+ // Schedule a Call
+ Com.Zoho.Crm.API.Record.Record whoId = new Com.Zoho.Crm.API.Record.Record();
+ whoId.Id = 4402481030088L;
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Calls.WHO_ID, whoId);
+ Com.Zoho.Crm.API.Record.Record whatId = new Com.Zoho.Crm.API.Record.Record();
+ whatId.Id = 440248884001L;
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Calls.WHAT_ID, whatId);
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Calls.CALL_TYPE, new Choice("Outbound"));
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Calls.OUTGOING_CALL_STATUS, new Choice("Scheduled"));
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Calls.CALL_START_TIME, new DateTimeOffset(new DateTime(2020, 05, 15, 12, 0, 0, DateTimeKind.Local)));
+ Com.Zoho.Crm.API.Record.Record user = new Com.Zoho.Crm.API.Record.Record();
+ user.Id = 440248254001L;
+ record1.AddKeyValue("Call_Owner", user);
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Calls.SUBJECT, "call scheduled");
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Calls.REMINDER, new Choice("5 mins"));
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Calls.CALL_PURPOSE, new Choice("Demo"));
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Calls.CALL_AGENDA, "agenda to make call");
+ record1.AddKeyValue("$se_module", "Accounts");
+ // log a Call
+ Com.Zoho.Crm.API.Record.Record whoId1 = new Com.Zoho.Crm.API.Record.Record();
+ whoId1.Id = 4402481030088L;
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Calls.WHO_ID, whoId1);
+ Com.Zoho.Crm.API.Record.Record whatId1 = new Com.Zoho.Crm.API.Record.Record();
+ whatId1.Id = 440248884001L;
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Calls.WHAT_ID, whatId1);
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Calls.CALL_TYPE, new Choice("Outbound"));
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Calls.SUBJECT, "call");
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Calls.CALL_DURATION, "10:00");
+ // record1.AddKeyValue("Voice_Recording__s", "recordingofcall.com");
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Calls.OUTGOING_CALL_STATUS, new Choice("Completed"));
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Calls.CALL_START_TIME, new DateTimeOffset(new DateTime(2020, 05, 15, 12, 0, 0, DateTimeKind.Local)));
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Calls.CALL_PURPOSE, new Choice("Demo"));
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Calls.CALL_AGENDA, "agenda to make call");
+ record1.AddKeyValue("Call_Result", new Choice("Not interested"));
+ record1.AddFieldValue(Com.Zoho.Crm.API.Record.Calls.DESCRIPTION, "desc");
+ record1.AddKeyValue("$se_module", "Accounts");
+ //
+ // Used when GDPR is enabled
+ Consent dataConsent = new Consent();
+ dataConsent.ConsentRemarks = "Approved.";
+ dataConsent.ConsentThrough = "Email";
+ dataConsent.ContactThroughEmail = true;
+ dataConsent.ContactThroughSocial = false;
+ dataConsent.ContactThroughPhone = true;
+ dataConsent.ContactThroughSurvey = true;
+ dataConsent.ConsentDate = new DateTime(2023, 10, 11).Date;
+ dataConsent.DataProcessingBasis = "Obtained";
+ record1.AddKeyValue("Data_Processing_Basis_Details", dataConsent);
+ // for MultiSelectLookUp/custom MultiSelectLookUp
+ List