Setting up the configuration is a system engineering process, for establishing and maintaining the consistency of the application's performance, functional and physical attributes with its requirements, design and operational information throughout its life.
In our Java SDK with ZohoCRM, two basic types of configurations are supported to hold OAuth information and ZCRM information. These configurations information are stored in property files with their respective attributes and values. The configuration files are,
Configuration - OAuth
Before you get started with creating your java application, you need to first authenticate the app with Zoho. And to do that there are some configuration procedures that need to be in place. Basically, two different property files are needed to be configured into the SDK to provide Oauth information and ZCRM Configuration information.
oauth_configuration.properties
OAuth Configuration file containing information about the necessary client id, secret, access type, etc. Those are all available when you register the app with Zoho. There are also some additional information that the file needs. The file must be in the below shown format with the following properties & their respective values.
client_id=
client_secret=
redirect_uri=
scope=
access_type=
persistence_handler_class=
mysql_username=
mysql_password=
oauth_tokens_file_path=
- client_id , client_secret and redirect_uri are your OAuth client’s configurations that you get after registering your Zoho client.
- scope can be one or many (comma separated) valid Zoho CRM scopes. Add Aaaserver.profile.Read scope along with your other required scopes. It is mandatory.
- access_type can be set to offline or online.
persistence_handler_class is your implementation of the ZohoPersistenceHandler interface, which has handler methods to store OAuth data. This is discussed in the next section.
For example: persistence_handler_class=com.zoho.oauth.clientapp.ZohoOAuthFilePersistence (or) com.zoho.oauth.clientapp.ZohoOAuthDBPersistence (or) your own persistence handler class.
If you prefer to use our DB persistence ( ZohoOAuthDBPersistence.java ) , you need to give the mysql_username and mysql_password keys for mysql connectivity.
- By default, mysql_username = root and mysql_password = .
- The tokens are generated and placed in the database table automatically(which is explained in the ZohoOauthDBPersistence section) once the authentication process is complete.
- In case you're using the File Persistence, the oauth_tokens_file_path is the relative path to a property file " oauthtokens.properties " that contains the access tokens, refresh tokens etc. The file needs to contain the following properties.
useridentifier=
accesstoken=
refreshtoken=
expirytime=
There is one more property file that needs to be added to the project.
Configuration - ZCRM
SDK also provides options to override certain HTTP request attributes. These configurations should be provided in this file. Create a similar property file,
zcrm_configuration.properties
The file must be in the below shown format with the following properties & their respective values.
minLogLevel=
currentUserEmail=
domainSuffix=
accessType=
Once both the configuration files are set, you can proceed to procure grant, access and refresh tokens for your application.