Important Terminologies
Client - The name of your application you want to register with your vertical solution org.
Resource - The application or service that the client is trying to access. In our case, the resource is the third-party service (ex: Dropbox) you are trying to integrate.
Request Token URL - The request token URL is the URL that the client uses to send an authorization request to the resource server. The resource server will then prompt the resource owner (the user) to authorize the request.
Access Token URL - Once the request is authorized by the resource owner, the server sends an access token to the client. This token has to be exchanged every time the clients wants to access the resource data.
Refresh Token URL - Some access tokens are valid only for a limited period of time. When an access token expires, the client has to get another access token from the resource, using the refresh token URL.
Client ID - A unique identifier provided to every client application. This ID is provided by the resource owner.
Client Secret - Every client application has a secret code mapped to it. This is done to prevent unauthorized access to the resource.
Redirect URL - This is the URL to which the end user will be redirected after authorization. The client application will generate a redirect URL automatically.
Connection Types
There are two types of connection.
- Default connection
- Custom connection
Currently, connection for a vertical service has to be created by individual orgs, as a Custom Connection.
Default Connection
Default connections are pre-built integrations between your vertical solutions org and other Zoho apps or third-party applications.
To create a connection with a default service:
- Go to Setup > Developer Space > Connections.
- Click Create Connection.
- Under Default Services, pick the service you want to integrate your solution with.
- In the Connection Details, enter the following details:
- Connection name : This will be the display name for your connection. Display name can contain up to 50 characters.
- Connection link name : Link names must be unique and can be used in Deluge integration tasks and invoke URL scripts to establish authentication.
Note : The link name that you provide must satisfy the following conditions:
It must begin with a lower case letter.
It can contain lower case letters, numbers, and underscores (_).
It can contain up to 50 characters.
- Choose appropriate scopes, as required.
- Click on Create and Connect.
- Your connection with a default service will be created and you will be redirected to an Authentication page. An example of Authenticating a Zoho Account page is shown below.
- Once you click on connect, you will be redirected to the respective service page.
- In the User Permissions window, provide your login credentials, and proceed. Or, click on Allow if you are already logged into the service.
- Upon successful authorization, you will be redirected to the Connection Summary page.
Custom Connection
Custom connections extends the ability for users to create integrations between a vertical solution account and any service, that may or may not be in the default serivces.
To create a custom connection:
- Go to Setup > Developer Space > Connections.
- Click Create Connection.
- Choose Custom Services and click Create New Service.
- In the Service Details, enter the following details:
- Service name: This is the display name of your service. Display name can contain up to 50 characters.
- Service link name: Link name of the service to help you to identify your custom service uniquely.
- Authentication Type: Choose from the following authentication types based on the desired service's API.
Authentication Type | Description | Fields |
API Key | This auth type requires you to specify the params for establishing a connection with the desired service. In the next step, you should supply values for these params to perform the integration. For example, if you specify authtoken as param, the next step would be to provide your account's auth token to establish a successful connection. | On choosing API Key as authentication type, you need to provide values to the following fields: - Actual Parameter: Name of the key (as specified in the API documentation of the desired service) against which the parameter needs to be sent. - Parameter Display Name: Display name for the parameter. This name will be prompted when you authenticate a connection. - Param Type: This decides how the authentication parameters will be sent along with the URLs specified in the invoke URL scripts. Supported param types: Query string, Form Data, and Header Note:
- You can add as many parameters as required. - Parameter could be any type of key that is required for authentication. Example: api-key, user-key, authtoken, apitoken, etc. |
Basic | This auth type requires you to specify the username and password in the next step. The provided username and password will be automatically encrypted with base64 algorithm and passed as header in the format: basic <encrypted_username>:<encrypted_password>. | N/A |
OAuth 1 | This auth type requires you to specify the required parameters to perform an OAuth 1 authentication. | On choosing OAuth 1 as authentication Type, you need to provide values to the following fields: - Consumer Key: Consumer key that is issued by the service provider. - Consumer Secret: Your consumer secret to authorize your application. - Request Token URL: URL to fetch the request token as specified in the API documentation of the desired service. - Authorize URL: Authorize URL as specified in the API documentation of the desired service. - Access Token URL: URL to fetch the access token as specified in the API documentation of the desired service. - Param Type: This decides how the authentication parameters will be sent along with the URLs specified in the invoke URL scripts. Supported param types: Query string, Form Data, and Header. |
OAuth 2 | This auth type requires you to specify the required parameters to perform an OAuth 2 authentication. | On choosing OAuth 2 as authentication Type, you need to provide values to the following fields: - Grant type: Grant type that the desired service uses to perform authorization. You can choose from the supported grant types: Authorization code and client credentials. - Client Id: Unique identifier provided to every client application. This ID is provided by the resource owner. - Client Secret: Every client application has a secret code mapped to it. This is done to prevent unauthorized access to the resource. - Authorize URL: This URL is used to send authorization requests to the resource server. The resource server prompts the resource owner (user) to authorize this request. - Access Token URL: Once the request is authorized by the resource owner, the server sends an access token to the client. This token has to be exchanged each time the clients wants to access the resource data. - Refresh Token URL: Some access tokens are valid only for a limited period of time. When an access token expires, the client has to get another access token from the resource, using the refresh token URL. - Param Type: This decides how the authentication parameters will be sent along with the URLs specified in the invoke URL scripts. Supported param types: Query string, and Header. Note: When registering a Zoho client in the required service's developer console, the callback URL needs to be: |
- Click Create Service to create the service
- Once a custom service is created, users can create a connection on that service. To create one, enter the following details.
- Connection name : This will be the display name for your connection. Display name can contain up to 50 characters.
- Connection link name : Link names must be unique. They can be used in Deluge integration tasks and invoke URL scripts to establish authentication.
Note: The link name that you provide must satisfy the following conditions. - It must begin with a lower case letter.
- It can contain lower case letters, numbers, and underscores (_).
- It can contain up to 50 characters
- Scope: (applicable only to OAuth 2 auth type): Provide the Scopes required to perform integration as specified in the desired service's API documentation.
- Scope Delimiter (applicable only to OAuth 2 auth type): Delimiter with which the desired service API expects the scopes to be separated.
- Click on Create and Connect.
- Your connection with the custom service will be created and you will be redirected to an Authentication page.
An example of Authenticating a Zoho Account page shown below.
- Once you click on connect, you will be redirected to the respective service page.
- In the User Permissions window, provide your login credentials, and proceed. Or, click on Allow if you are already logged into the service.
- Upon successful authorization, you will be redirected to the Connection Summary page.
Using a Connection
After you have created a Connection, you can use it by calling an InvokeUrl task or Zoho's integrations tasks.
When Connections are used to create integrations or connections between a vertical solution account and other applications, the InvokeURL task can be used to perform actions on the integrated application.
Once a connection is created, the sample code in Deluge and JSON for the connection will be available. You may copy the sample and use the same in your code.
To know more about Zoho's
invokeUrl task, refer
here.
With Zoho having its own integrations tasks, users can utilize them in the vertical solutions applications to interact with other Zoho products. Connection is one of the parameters, where users are required to provide the connection link name.
In the following example, we show the syntax of the task used to fetch records from the specified Zoho CRM module.
<variable> = zoho.crm.getRecords(<module_name>, <page>, <per_page>, <query_value>, <connection>);
Here, <connection> has to be replaced with your connection link name.
To know more about Zoho's integrations tasks, refer
here.