![]() ![]() * if false - the SDK does not validate the input and makes the API request with the user’s input to the pick list */ let sdkConfig = new SDKConfigBuilder ( ). ![]() If the value does not exist in the pick list, the SDK throws an error. The user can manually delete the file(s) or refresh the fields using methods from ModuleFieldsHandler(utils/util/module_fields_handler.js) * * pickListValidation (default - true) * A boolean field that validates user input for a pick list field and allows or disallows the addition of a new value to the list. * if false - the fields will not be auto-refreshed in the background. MasterModel /* By default, the SDK creates the SDKConfig instance * autoRefreshFields (default - false) * if true - all the modules' fields will be auto-refreshed in the background, every hour. By default, the SDK constructs a Logger instance with level - INFO and file_path - (sdk_logs.log parallel to node_modules)Ĭonst SDKConfigBuilder = require ( ). build ( ) Ĭreate an instance of Logger Class to log exception and API information. build ( ) // if access token is available let token = new OAuthBuilder ( ). build ( ) // if ID (obtained from persistence) is available let token = new OAuthBuilder ( ). build ( ) // if grant token is available let token = new OAuthBuilder ( ). ![]() */ //Create a Token instance // if refresh token is available // The SDK throws an exception, if the given id is invalid. OAuthBuilder /* * Create a Token instance that requires the following * clientId -> OAuth client id. Mandatory KeysĬreate an instance of UserSignature that identifies the current user.Ĭonst OAuthBuilder = require ( ). TokenStore class CustomStore extends TokenStore Configurationīefore you get started with creating your NodeJS application, you need to register your client and authenticate the app with Zoho. Custom database name and table name can be set in DBStore instance.Ĭonst TokenStore = require ( ).There must be a table name oauthtoken with columns. In case the user prefers to use the default DataBase persistence, MySQL can be used. GetTokenById(id, token) - The method to retrieve the user's token details based on unique ID. GetTokens() - The method to retrieve all the stored tokens.ĭeleteTokens() - The method to delete all the stored tokens. SaveToken(user, token) - invoked after fetching access and refresh tokens from Zoho.ĭeleteToken(token) - invoked before saving the latest tokens. This method should return implementation Token Class object for the library to process it. GetToken(user, token) - invoked before firing a request to fetch the saved tokens. The persistence is achieved by writing an implementation of the inbuilt TokenStore Class, which has the following callback methods. Hence, they need to be persisted by the client app. Once the application is authorized, OAuth access and refresh tokens can be used for subsequent user data requests to Zoho CRM. They are DataBase Persistence, File Persistence and Custom Persistence. There are three ways provided by the SDK in which persistence can be utilized. Token persistence refers to storing and utilizing the authentication tokens that are provided by Zoho. Run npm install in the directory which installs all the dependencies mentioned in package.json.Add dependencies to the package.json of the node server with the latest version (recommended).Npm install NodeJS SDK will be installed and a package named will be created in the local machine. Navigate to the workspace of your client app.NodeJS SDK must be installed in the client app through npm. SDK expects the following from the client app:Ĭlient app must have Node(version 12 and above) npm is a tool for dependency management in NodeJS. Generate grant token by providing the necessary scopes, time duration (the duration for which the generated token is valid) and Scope Description. To register your app:Įnter Client Name, Client Domain or Homepage URL and Authorized Redirect URIs then click CREATE. Since Zoho CRM APIs are authenticated with OAuth2 standards, you should register your client app with Zoho. Zoho CRM NodeJS SDK offers a way to create client NodeJS applications that can be integrated with Zoho CRM. ZOHO CRM NODEJS SDK - 2.0 Table Of Contents See the License for the specific language governing permissions and ![]() WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Unless required by applicable law or agreed to in writing, softwareĭistributed under the License is distributed on an "AS IS" BASIS, You may not use this file except in compliance with the License. Licensed under the Apache License, Version 2.0 (the "License") Copyright (c) 2021, ZOHO CORPORATION PRIVATE LIMITED ![]()
0 Comments
Leave a Reply. |