<repositories> <repository> <id>zohocrmsdk-5-0</id> </repository> </repositories> <dependencies> <dependency> <groupId>com.zoho.crm</groupId> <artifactId>zohocrmsdk-5-0</artifactId> <version>4.0.0</version> </dependency> </dependencies> |
public static Boolean integrateZohoCRM(String location, String grant_token, String user_email) { Boolean integrationStatus = Boolean.FALSE; try { Environment environment = DataCenter.get(location); OAuthToken userToken = new OAuthToken.Builder() .clientID(OAuthClientDetails.CLIENT_ID) .clientSecret(OAuthClientDetails.CLIENT_SECRET) .grantToken(grant_token) .redirectURL(OAuthClientDetails.REDIRECT_URL) .userSignature(new UserSignature(user_email)) //email of the user who is trying to integrate with Zoho CRM .build(); new Initializer.Builder().environment(environment).token(userToken).initialize(); integrationStatus = Boolean.TRUE; } catch (SDKException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } return integrationStatus; } |
new Initializer.Builder().environment(environment).token(userToken).initialize(); |
"id","user_name","client_id","client_secret","refresh_token","access_token","grant_token","expiry_time","redirect_url","api_domain" //Do not clear this default format, or else you will need to generate a grant token again in order to run the program. "1","patricia@gmail.com","1000.xxxxx","xxxxxx","1000.xxxxxx.xxxx","1000.xxxxxxxxx.xxxxxxx","1000.xxxxxxxxx.xxxxxxx","1697370902510","https://www.zoho.com","https://www.zohoapis.com" |
public static void fetchCRMData(String email) throws Exception { OAuthToken userToken1 = new OAuthToken.Builder() .userSignature(new UserSignature(email)) .build(); new Initializer.Builder().token(userToken1).initialize(); RecordOperations ro = new RecordOperations(); ParameterMap paramInstance = new ParameterMap(); List < String > fieldNames = new ArrayList < > (Arrays.asList("Company", "Email")); paramInstance.add(RecordOperations.GetRecordsParam.FIELDS, String.join(",", fieldNames)); @SuppressWarnings("rawtypes") APIResponse response = ro.getRecords("Leads", paramInstance, null); . . . } |
Writer is a powerful online word processor, designed for collaborative work.