Giter Club home page Giter Club logo

zoho's Introduction

About this connector

This is the second version of the connector for Zoho. It wraps part of the CRM and DESK API exposed by zoho with full JavaScript objects that can be directly used from within your scripts in scriptr.io.

The first version is still accessible in branch v1 of this repository

How to use

Check the /test/tests that contains many usage scenarios.

How to configure

The /config script contains some variables used to configure the connector. In normal circumstances, you only need to specify/change the values of the following: client_id, client_secret and redirect_uri.

Before you do that, make sure to create a zoho application using zoho's developer console. Note that the "Authorized redirect URIs" field should point to the /oauth/getAccessToken script of your zoho deployment (in your scriptr.io IDE) and must be prefixed with a valid scriptr.io auth token. Example:

// the token used in the below is for illustration purposes only
https://api.scriptrapps.io/zoho/oauth/getAccessToken?auth_token=UlIxQMgwRjc3Njl6b9hvXeNvnm5lL3RvckpCDDA1Qjc1RTlBOTA0NEJFMUVBQjcxRkY0ATcxMlc1Nw== 

Once done creating the zoho app in zoho's developer console, copy/paste the values of the client_id, client_secret and authorized url respectively into the client_id, client_secret and redirect_uri variables of the config file of the connector.

Note1: to obtain a scriptr.io auth token, click on your username in the scriptr.io workspace, then click on "Device directory". Create a device or use an existing one then just copy the generated token.

Note2: in the above examples, we assumed that the zoho connector was deployed in /zoho. Make sure it is the case in your scriptr.io workspace, otherwise, fix accordingly to match your current deployment. For example, if zoho is deployed in /modules/zoho, then the callback URL should be https://api.scriptrapps.io/modules/zoho/oauth/getAccessToken?auth_token=<your_auth_token>

Note3: Make sure to use the right zoho scope as it could lead to request failure (checks the scriptr.io logs for potential 403 error code). The scope varies depending on the API operation. Desk scopes can be found here

How to generate an access token from zoho

You can do this manually using the following steps (or you can automate the process using the same scripts):

  • Step1: send an authorization grant request by executing the /oauth/getAuthorizationGrant script. Make sure to pass "username=<some_username>" as a query parameter. As a result, you will obtain the URL of the zoho access grant form.
  • Step2: Open the URL in a browser. Sign-in to zoho and grant the requested permissions. The browser will redirect to the /oauth/getAccessToken script, which will persist the resulting access_token and refresh_token for the provided username.

Starting from there, the zoho connector will automatically refresh the token using the obtained refresh_token.

Backward compatibility

This version of the connector maintains backward compatibility with the former version. Any scriptr.io application that was using this latter needs to replace the zoho connector with the new one. The legacy pathes and script names are kept the same. The only required changes are the following:

In the /config file, fill the "user" variable of the "Backward compatibility variables" section with a username for which you already have obtained an access token from zoho (see "How to generate an access token from zoho"). Alternatively, you can specify the user when creating an instance of the zoho compatibility class

Example:

var zohoCompatibilityModule = require("/modules/zoho/lib/zoho"); // we assume that the zoho connector is deployed in /modules/zoho
var config = {
        
   user: "username_with_access_token", // you should now pass a username for which you have an access_token
   portal: "your_portal_name",
   department: "your_department_name"
};
    
var legacyZoho = new zohoCompatibilityModule.zoho(config);

Miscellaneous

  • In the current you must create contacts in Zoho and use any of those contacts when creating tickets from the connector (you can use the connector to create contacts. Make sure you have the right OAuth scope)

zoho's People

Contributors

esfeir avatar karimsaikali avatar manollyjohnny avatar marvettefeghali avatar scriptrdotio avatar waabuffet avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.