Creating an integration component (Commands, Bots, Message Actions, Functions) that connects Cliq with another third party service can be implemented by Cliq Connections.
Now let us assume you are building a
Wrike extension for Cliq. You want the extension to be power packed with all the below features -
- Slash command to show the tasks you've added in your list.
- A bot that notifies you when a task is assigned to you and also reminder notifications for upcoming tasks!
- A message action to create a new task right from Cliq.
The most important step here would be to establish a way to connect Cliq and Asana. The best possible and also the most widely used method available right now is with OAuth 2.0
What is OAuth 2.0?
Open Authorization or OAuth, is a standard protocol that applications use to provide authentication and allow secured and limited access to an application. In this case, access Asana from right from Cliq.
Implementing OAuth 2.0 is quite cumbersome with all the different authorization grants available followed by the number of tokens that need to be generated in order to validate a user's identity.
Connections execute the OAuth process for you!
Cliq Connections take care of this authorization process for any application you would like to integrate with. All you've to do is register your application (in this case, Cliq) with a third party service (Asana) and get a Client ID and Client Secret.
Types of Cliq Connections
There are two different types of Cliq connections available.
- Connections listed under Pick Your Service
- Custom Service Connections
Connections listed under Pick your Service
Zoho already provides connections readily available with a list of services. The help page on 'Connections' explains how to create connection with a service listed under the Pick Your Service section.
Creating a Custom Service Connection
A simple example on how to create a custom connection with Wrike is given below:
Steps to be done in Wrike:
1. The first step is to register your application (Cliq) in Wrike by giving the application name and redirect URL. Redirect URL is an important process in OAuth. Once an application is successfully authorized, the application redirects the user to this particular URL with a code or token.
2. Generate a Client ID and Client Secret
Steps to be done in Cliq:
1. In the Add Connections page, select Custom Service
3. In the Service Details section, add the following details for the respective fields:
Note: Refer
this help page for the authorize URL, access token URL and the refresh token URL.
4. In the Connection Details section, give your connection name.
5. Use Credentials of Login User: Enabling this option will ensure that, a user is using their own credentials while performing the integration. If this option is disabled, then the connection will use the admin (connection owner's) credentials to perform the integration.
6. Scope: OAuth scopes allow you to define exactly what data your application can access. For this example, we'll be defining the scopes required to access the 'Tasks' module in Wrike. Refer the scopes given for this module in
this help page
7. Click Create and Connect
8. Use the generated 'Invoke URL' task in your commands, bots, message actions!
This is simple pictorial representation how the custom connection works.
Below shown is a simple example on how to access the list of tasks in your Wrike Account directly from Cliq via a simple Slash Command.
The source code for the command shown in the video is given below! Try creating the custom connection and executing this command.
- message = Map();
- response = invokeurl
- [
- url : "
- https://www.wrike.com/api/v3/tasks
- "
- type :GET
- connection:"wrike"
- ];
- taskDetails = response.get("data").toMap().get("title");
- taskURL = response.get("data").toMap().get("permalink");
- message.put("text","Tasks present in Wrike: \n Task Name: " + taskDetails + " \n Task URL: " + taskURL);
- return message;
Now you're all set to create a killer integration with Cliq! So get started. Comments and suggestions are welcome.
Best,
Manasa
Cliq