Skip to content

Commit

Permalink
Merge pull request #8 from zoho/beta
Browse files Browse the repository at this point in the history
5.0.0
  • Loading branch information
raja-7453 authored Oct 9, 2024
2 parents 876bc5f + 70a89b6 commit b7e9035
Show file tree
Hide file tree
Showing 2,064 changed files with 239,704 additions and 700 deletions.
70 changes: 65 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,66 @@ License

## Latest Version

- [5.0.0](/versions/5.0.0/README.md)

- Added new **page_token** param in GetAttachmentsParam class.
- DealContactRolesOperations class method name chnaged(deleteContactRoleRealation to deleteContactRoleRelation).
- Added **category**, **sort_by**, **sort_order**, and **filters** param in GetEmailTemplatesParam class.
- Added new fields (**referenceValue**, **dealCategory**, and **showValue**) in fields PickListValue class.
- Added new **filters** param in GetInventoryTemplatesParam class.
- Modules displayField field datatype changed(String to Object).
- Added new **status** param in GetModulesParam class.
- Added new **paramInstance** param in ModulesOperations class **getModules** method.
- Added new **type** param in SearchRecordsParam class.
- Added new **cvid** param in RecordCountParam class.
- Added new **page_token**, **page**, and **per_page** param in GetRecordLockingInformationsParam class.
- Added new **color_code** param in CreateTagsParam class.
- Added new **ids** param in GetTerritoriesParam class.
- Added new **page** and **per_page** param in GetChildTerritoryParam class.
- Added new **filters**, **page**, and **per_page** param in GetAssociatedUsersCountParam class.
- Added new **paramInstance** param in UserGroupsOperations class **getAssociatedUsersCount** method.
- Deprecated and removed API methods:
- UsersTerritories
- validateBeforeTransferForAllTerritories
- validateBeforeTransfer
- delinkAndTransferFromAllTerritories
- delinkAndTransferFromSpecificTerritory
- Support for the following new APIs
- AuditLogExport
- [Download Export Audit Log Result](https://www.zoho.com/crm/developer/docs/api/v7/download-export-audit-log-result.html)
- Cadences
- [Cadence API](https://www.zoho.com/crm/developer/docs/api/v7/cadences/get-cadences.html)
- DealContactRoles
- [Remove Contact Role from a Specific Deal](https://www.zoho.com/crm/developer/docs/api/v7/remove-contact-role-from-a-specific-deal.html)
- InventoryConvert
- [Convert Inventory Records](https://www.zoho.com/crm/developer/docs/api/v7/inventory-convert.html)
- InventoryMassConvert
- [Mass Convert Inventory Records](https://www.zoho.com/crm/developer/docs/api/v7/mass-inventory-convert.html)
- [Get Mass Inventory Conversion Status](https://www.zoho.com/crm/developer/docs/api/v7/mass-inventory-conversion-status-api.html)
- Layouts
- [Update Custom Layout](https://www.zoho.com/crm/developer/docs/api/v7/update-custom-layout.html)
- [Delete Custom Layout](https://www.zoho.com/crm/developer/docs/api/v7/delete-custom-layout.html)
- [Activate Custom Layout](https://www.zoho.com/crm/developer/docs/api/v7/activate-custom-layout.html)
- [Deactivate Custom Layout](https://www.zoho.com/crm/developer/docs/api/v7/deactivate-custom-layout.html)
- Modules
- [Create Custom Module](https://www.zoho.com/crm/developer/docs/api/v7/create-custom-module-api.html)
- Record
- [Get Rich Text Fields](https://www.zoho.com/crm/developer/docs/api/v7/get-rich-text-fields.html)
- RecordLockingConfiguration
- [Record Locking Configuration APIs](https://www.zoho.com/crm/developer/docs/api/v7/get-record-locking-config.html)
- [Add Record Locking Configuration](https://www.zoho.com/crm/developer/docs/api/v7/add-record-locking-config.html)
- [Update Record Locking Configuration](https://www.zoho.com/crm/developer/docs/api/v7/update-record-locking-config.html)
- [Delete Record Locking Configuration](https://www.zoho.com/crm/developer/docs/api/v7/delete-record-locking-config.html)
- RecycleBin
- [Get Recycle Bin Records](https://www.zoho.com/crm/developer/docs/api/v7/get-recycle-bin.html)
- [Delete Recycle Bin Records](https://www.zoho.com/crm/developer/docs/api/v7/del-recycle-bin-records.html)
- usergroups
- [Associated Groups of a User](https://www.zoho.com/crm/developer/docs/api/v7/associated-groups-of-a-user.html)
- UsersTerritories
- [Remove Territories from User](https://www.zoho.com/crm/developer/docs/api/v7/remove-territories-from-user.html)
- ZiaEnrichment
- [Enrichment Configuration](https://www.zoho.com/crm/developer/docs/api/v7/zia-enrichment/get-config.html)

- [4.0.0](/versions/4.0.0/README.md)

- Email Related Records Email class threadId field datatype changed(Long to String).
Expand Down Expand Up @@ -64,10 +124,10 @@ For older versions, please [refer](https://github.com/zoho/zohocrm-java-sdk-7.0/
## Including the SDK in your project
You can include the SDK to your project using:
- Maven
- [Gradle](/versions/4.0.0/README.md#including-the-sdk-in-your-project)
- [Download SDK jar](https://maven.zohodl.com/com/zoho/crm/zohocrm-java-sdk-7-0/4.0.0/zohocrm-java-sdk-7-0-4.0.0.jar)
- [Gradle](/versions/5.0.0/README.md#including-the-sdk-in-your-project)
- [Download SDK jar](https://maven.zohodl.com/com/zoho/crm/zohocrm-java-sdk-7-0/5.0.0/zohocrm-java-sdk-7-0-5.0.0.jar)

For including the latest [version](https://github.com/zoho/zohocrm-java-sdk-7.0/releases/tag/4.0.0) using Maven, include the following in your **pom.xml** file, which will get created once your **Java** project is created using Maven.
For including the latest [version](https://github.com/zoho/zohocrm-java-sdk-7.0/releases/tag/5.0.0) using Maven, include the following in your **pom.xml** file, which will get created once your **Java** project is created using Maven.

```xml
<repositories>
Expand All @@ -80,7 +140,7 @@ For including the latest [version](https://github.com/zoho/zohocrm-java-sdk-7.0/
<dependency>
<groupId>com.zoho.crm</groupId>
<artifactId>zohocrm-java-sdk-7-0</artifactId>
<version>4.0.0</version>
<version>5.0.0</version>
</dependency>
</dependencies>
```
Expand All @@ -100,4 +160,4 @@ For example, if you generate the tokens for your Sandbox environment in the CN d
---

For more details, kindly refer [here](/versions/4.0.0/README.md).
For more details, kindly refer [here](/versions/5.0.0/README.md).
112 changes: 112 additions & 0 deletions samples/auditlogexport/DownloadExportAuditLogResult.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
package samples.auditlogexport;

import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Map;

import com.zoho.api.authenticator.OAuthToken;
import com.zoho.api.authenticator.Token;
import com.zoho.crm.api.Initializer;
import com.zoho.crm.api.auditlogexport.APIException;
import com.zoho.crm.api.auditlogexport.AuditLogExportOperations;
import com.zoho.crm.api.auditlogexport.FileBodyWrapper;
import com.zoho.crm.api.auditlogexport.ResponseHandler;
import com.zoho.crm.api.dc.USDataCenter;
import com.zoho.crm.api.dc.DataCenter.Environment;
import com.zoho.crm.api.util.APIResponse;
import com.zoho.crm.api.util.Model;
import com.zoho.crm.api.util.StreamWrapper;

public class DownloadExportAuditLogResult
{
public static void downloadExportAuditLogResult(String downloadUrl, String destinationFolder) throws Exception
{
AuditLogExportOperations auditLogExportOperations = new AuditLogExportOperations();
APIResponse<ResponseHandler> response = auditLogExportOperations.downloadExportAuditLogResult(downloadUrl);
if (response != null)
{
System.out.println("Status Code: " + response.getStatusCode());
if (Arrays.asList(204, 304).contains(response.getStatusCode()))
{
System.out.println(response.getStatusCode() == 204 ? "No Content" : "Not Modified");
return;
}
if (response.isExpected())
{
ResponseHandler responseHandler = response.getObject();
if (responseHandler instanceof FileBodyWrapper)
{
FileBodyWrapper fileBodyWrapper = (FileBodyWrapper) responseHandler;
StreamWrapper streamWrapper = fileBodyWrapper.getFile();
File file = new File(destinationFolder + File.separatorChar + streamWrapper.getName());
InputStream is = streamWrapper.getStream();
OutputStream os = new FileOutputStream(file);
byte[] buffer = new byte[1024];
int bytesRead;
while ((bytesRead = is.read(buffer)) != -1)
{
os.write(buffer, 0, bytesRead);
}
is.close();
os.flush();
os.close();
}
else if (responseHandler instanceof APIException)
{
APIException exception = (APIException) responseHandler;
if (exception.getStatus() != null)
{
System.out.println("Status: " + exception.getStatus().getValue());
}
if (exception.getCode() != null)
{
System.out.println("Code: " + exception.getCode().getValue());
}
if (exception.getDetails() != null)
{
System.out.println("Details: ");
for (Map.Entry<String, Object> entry : exception.getDetails().entrySet())
{
System.out.println(entry.getKey() + ": " + entry.getValue());
}
}
if (exception.getMessage() != null)
{
System.out.println("Message: " + exception.getMessage());
}
}
}
else
{
Model responseObject = response.getModel();
Class<? extends Model> clas = responseObject.getClass();
java.lang.reflect.Field[] fields = clas.getDeclaredFields();
for (java.lang.reflect.Field field : fields)
{
field.setAccessible(true);
System.out.println(field.getName() + ":" + field.get(responseObject));
}
}
}
}

public static void main(String[] args)
{
try
{
Environment environment = USDataCenter.PRODUCTION;
Token token = new OAuthToken.Builder().clientID("Client_Id").clientSecret("Client_Secret").refreshToken("Refresh_Token").build();
new Initializer.Builder().environment(environment).token(token).initialize();
String downloadUrl = "https://download-accl.zoho.com/v2/crm/xxxxx/auditlog/3477725001/AuditLog.csv";
String destinationFolder = "/Users/user_name/Documents";
downloadExportAuditLogResult(downloadUrl, destinationFolder);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
19 changes: 10 additions & 9 deletions samples/auditlogexport/GetExportedAuditlog.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
package samples.auditlogexport;

import java.lang.reflect.Field;
import java.util.List;
import java.util.Map;

import com.zoho.api.authenticator.OAuthToken;
import com.zoho.api.authenticator.Token;

import com.zoho.crm.api.Initializer;
import com.zoho.crm.api.auditlogexport.APIException;
import com.zoho.crm.api.auditlogexport.AuditLogExport;
import com.zoho.crm.api.auditlogexport.AuditLogExportOperations;
import com.zoho.crm.api.auditlogexport.Criteria;
import com.zoho.crm.api.auditlogexport.ResponseHandler;
import com.zoho.crm.api.auditlogexport.ResponseWrapper;
import com.zoho.crm.api.auditlogexport.User;
import com.zoho.crm.api.auditlogexport.Criteria;
import com.zoho.crm.api.dc.USDataCenter;
import com.zoho.crm.api.dc.DataCenter.Environment;
import com.zoho.crm.api.dc.USDataCenter;
import com.zoho.crm.api.util.APIResponse;
import com.zoho.crm.api.util.Model;
import java.lang.reflect.Field;
import java.util.List;
import java.util.Map;

public class GetExportedAuditlog
{
Expand Down Expand Up @@ -59,9 +57,12 @@ public static void getExportedAuditlog(Long Id) throws Exception
System.out.println("AuditLogExport User Id : " + createdBy.getName());
}
List<String> downloadLinks = auditLogExport1.getDownloadLinks();
for(String link : downloadLinks)
if(downloadLinks != null)
{
System.out.println("AuditLogExport DownloadLink : " + link);
for(String link : downloadLinks)
{
System.out.println("AuditLogExport DownloadLink : " + link);
}
}
System.out.println("AuditLogExport JobStartTime : " + auditLogExport1.getJobStartTime());
System.out.println("AuditLogExport JobEndTime : " + auditLogExport1.getJobEndTime());
Expand Down
7 changes: 5 additions & 2 deletions samples/auditlogexport/GetExportedAuditlogs.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ public static void getExportedAuditlogs() throws Exception
System.out.println("AuditLogExport User Id : " + createdBy.getName());
}
List<String> downloadLinks = auditLogExport1.getDownloadLinks();
for(String link : downloadLinks)
if(downloadLinks != null)
{
System.out.println("AuditLogExport DownloadLink : " + link);
for(String link : downloadLinks)
{
System.out.println("AuditLogExport DownloadLink : " + link);
}
}
System.out.println("AuditLogExport JobStartTime : " + auditLogExport1.getJobStartTime());
System.out.println("AuditLogExport JobEndTime : " + auditLogExport1.getJobEndTime());
Expand Down
2 changes: 1 addition & 1 deletion samples/backup/GetDetails.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public static void main(String[] args)
try
{
Environment environment = USDataCenter.PRODUCTION;
Token token = new OAuthToken.Builder().clientID("Client_Id").clientSecret("Client_Secret").refreshToken("Refresh_Token").redirectURL("Redirect_URL").build();
Token token = new OAuthToken.Builder().clientID("Client_Id").clientSecret("Client_Secret").refreshToken("Refresh_Token").build();
new Initializer.Builder().environment(environment).token(token).initialize();
getDetails();
}
Expand Down
15 changes: 7 additions & 8 deletions samples/bulkwrite/DownloadBulkWriteResult.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
package samples.bulkwrite;

import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Map;

import com.zoho.api.authenticator.OAuthToken;
import com.zoho.api.authenticator.Token;
import com.zoho.crm.api.Initializer;
import com.zoho.crm.api.bulkwrite.APIException;
import com.zoho.crm.api.bulkwrite.BulkWriteOperations;
import com.zoho.crm.api.bulkwrite.FileBodyWrapper;
import com.zoho.crm.api.bulkwrite.ResponseHandler;
import com.zoho.crm.api.dc.USDataCenter;
import com.zoho.crm.api.dc.DataCenter.Environment;
import com.zoho.crm.api.dc.USDataCenter;
import com.zoho.crm.api.util.APIResponse;
import com.zoho.crm.api.util.Model;
import com.zoho.crm.api.util.StreamWrapper;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Map;

public class DownloadBulkWriteResult
{
Expand Down
7 changes: 3 additions & 4 deletions samples/bulkwrite/UploadFile.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package samples.bulkwrite;

import java.util.Map;

import com.zoho.api.authenticator.OAuthToken;
import com.zoho.api.authenticator.Token;
import com.zoho.crm.api.HeaderMap;
import com.zoho.crm.api.Initializer;
import com.zoho.crm.api.bulkwrite.APIException;
import com.zoho.crm.api.bulkwrite.ActionResponse;
import com.zoho.crm.api.bulkwrite.BulkWriteOperations;
import com.zoho.crm.api.bulkwrite.SuccessResponse;
import com.zoho.crm.api.bulkwrite.BulkWriteOperations.UploadFileHeader;
import com.zoho.crm.api.dc.USDataCenter;
import com.zoho.crm.api.bulkwrite.SuccessResponse;
import com.zoho.crm.api.dc.DataCenter.Environment;
import com.zoho.crm.api.dc.USDataCenter;
import com.zoho.crm.api.util.APIResponse;
import com.zoho.crm.api.util.Model;
import com.zoho.crm.api.util.StreamWrapper;
import java.util.Map;

public class UploadFile
{
Expand Down
12 changes: 5 additions & 7 deletions samples/businesshours/UpdateBusinessHours.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
package samples.businesshours;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.zoho.api.authenticator.OAuthToken;
import com.zoho.api.authenticator.Token;

import com.zoho.crm.api.Initializer;
import com.zoho.crm.api.businesshours.APIException;
import com.zoho.crm.api.businesshours.ActionHandler;
Expand All @@ -18,11 +12,15 @@
import com.zoho.crm.api.businesshours.BusinessHours;
import com.zoho.crm.api.businesshours.BusinessHoursOperations;
import com.zoho.crm.api.businesshours.SuccessResponse;
import com.zoho.crm.api.dc.USDataCenter;
import com.zoho.crm.api.dc.DataCenter.Environment;
import com.zoho.crm.api.dc.USDataCenter;
import com.zoho.crm.api.util.APIResponse;
import com.zoho.crm.api.util.Choice;
import com.zoho.crm.api.util.Model;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class UpdateBusinessHours
{
Expand Down
Loading

0 comments on commit b7e9035

Please sign in to comment.