-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from zoho/beta
3.0.0
- Loading branch information
Showing
1,570 changed files
with
173,009 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<ResponseHandler> response = apisOperations.GetSupportedAPI(); | ||
if (response != null) | ||
{ | ||
Console.WriteLine("Status Code: " + response.StatusCode); | ||
if (new List<int>() { 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<SupportedAPI> apis = responseWrapper.Apis; | ||
foreach (SupportedAPI api in apis) | ||
{ | ||
Console.WriteLine("API Path : " + api.Path); | ||
List<OperationTypes> 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<string, object> 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 <Indexed>", 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)); | ||
} | ||
} | ||
} | ||
} | ||
|
125 changes: 125 additions & 0 deletions
125
versions/3.0.0/Samples/AuditLogExport1/CreateAuditlogExport.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> auditLogExport = new List<AuditLogExport>(); | ||
AuditLogExport auditLogExport1 = new AuditLogExport(); | ||
Criteria criteria = new Criteria(); | ||
criteria.Comparator = "between"; | ||
Field field = new Field(); | ||
field.APIName = "audited_time"; | ||
criteria.Field = field; | ||
List<DateTimeOffset> values = new List<DateTimeOffset>(); | ||
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<ActionHandler> 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<ActionResponse> 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<string, object> 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<string, object> 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<string, object> 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 <Indexed>", 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)); | ||
} | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.