Generating an OAuth 2 token for Cliq

Generating an OAuth 2 token for Cliq

OAuth 2.0 protocol is a way to authorize and authenticate API requests. It allows third party application developers to let their users access and use the resources securely. This post will walk you through the steps involved in generating an OAuth 2 token for Cliq.

Follow the steps given below to know more on how to generate an OAuth 2 token for Cliq.


Step 1: Generate Client id and Client secret 


You will need to register your client app before getting started. A registered client app will be assigned a Client ID and a Client Secret which will be used in the OAuth flow. The Client ID is a public identifier for applications. Although it is public, it is best that it is not guessable to prevent attacks on the arbitrary applications possibly. On the other hand, the Client Secret is a secret only known to the application and the authorization server. 

  1. Visit the Cliq developer console and register your client application and include the following details
  • Client Name : The name of the application that you want to register with. This name will be shown in the consent displayed to the user while granting access to the required scopes.
  • Client Domain: A domain name to be used in the URL to identify your brand name uniquely.
  • Authorized redirect URL's: Callback URL to which user's will be redirected upon successful authorization.
      2. Click on the Create button.

Step 2: Authorization by generating a grant token 


The second step is to redirect the user of the client application to an authorized endpoint (https://accounts.zoho.com/oauth/v2/auth). Cliq will ensure the consent for the permissions that your app requests. In this step, after the consent is obtained, Cliq will redirect to your app along with the code that can be used in generating an Access token.

Type in the URL along with the mandatory parameters given below.

https://accounts.zoho.com/oauth/v2/auth?scope={scope}&client_id={client_id}&state=5466400890088961855&response_type=code&redirect_uri={redirect_uri}&access_type=offline 

Note:Mandatory parameters are indicated with a *.

Parameter
Description 
scope*
Scope helps you access application data. 
You can include multiple scopes by separating them with a comma.
For example (ZohoCliq. Channels.READ,ZohoCliq.Channels.UPDATE). 
client_id*
The client-id obtained while registering your application.
state
This parameter is used to maintain the state between the request and callback.
response_type*
The value of the param response_type should always be code.
redirect_uri*
It specifies the URL to which the page is redirected along with the code when the user grants an access.
access-type
Enter the access type as online or offline. 
online- To generate only the Access token.
offline- To generate both the Access and the Refresh Tokens.

Step 3: Generating Access and Refresh tokens 

The value of the code parameter obtained in the previous step will be used in generating the Access and the Refresh token. 
Make a POST request to the following URL along with the parameters mentioned below. 

https://accounts.zoho.com/oauth/v2/token?code={code}&grant_type=authorization_code&scope={scope}&client_id={client_id}&client_secret={client_secret}&redirect_uri={redirect_uri} 


Parameter
Description
code*
The authorization code obtained while generating the grant token.
client_id*
The client-id obtained while registering the application.
client_secret*
The client-secret obtained during the application registration.
redirect_uri*
Include the redirect URI mentioned while registering your client application.

grant_type*

authorization_code
scope
Mention the scope for your extension.

Note: The generated code is valid for only one minute.
On making a successful request, you will receive the following response
  1. {
  2. "access_token": "1000.365170ed0e63c47bf759439c1897fee0.7c3a098808532004faba21ff291ec296",
  3. "refresh_token": "1000.368e377f885b7e2ff696479625b3e150.6cad850717614193bddbf489b6a437d6",
  4. "api_domain": "https://www.zohoapis.com",
  5. "token_type": "Bearer",
  6. "expires_in": 3600
  7. }
  1. access_token - Access token to access Zoho Cliq APIs.
  2. refresh_token - Refresh tokens to generate new Access tokens.
  3. api_domain - Domain name of the API. Use this domain in your requests to make API calls to Zoho Cliq.
  4. token_type - Type of the token obtained. Bearer in this case.
  5. expires_in - Time in milliseconds after which the token expires.

Note: 1. Each access token is valid only for an hour
2. Refresh tokens do not expire and can be used any number of times to generate new access tokens. 

Step 4: Generating the Access token from the Refresh token

Now to generate a new Access token, use the refresh token from the previous step. 
Make a POST request to the given URL along with the parameters mentioned below.

https://accounts.zoho.com/oauth/v2/token?refresh_token={refresh_token}&grant_type=refresh_token&scope={scope}&client_id={client_id}&client_secret={client_secret}&redirect_uri={redirect_uri}

Parameter

Description
client_id*
The client_id obtained while registering your application.
client_secret*
The client_secret obtained while registering your application.
redirect_uri
The redirect uri mentioned during the client registration.

grant_type*

refresh_token
refresh_token*
The refresh token obtained in the previous step.

scope*

The suitable scope for your extension.

Note: A user in an organization can have a maximum of 20 refresh tokens and each refresh token can have a maximum of 30 active Access tokens.



So that was all about generating an OAuth 2 token for Cliq. In case of any queries please do comment below. We'd be happy to assist you.

Regards,
Divya P 
Cliq













    • Sticky Posts

    • Automating Employee Birthday Notifications in Zoho Cliq

      Have you ever missed a birthday and felt like the office Grinch? Fear not, the Cliq Developer Platform has got your back! With Zoho Cliq's Schedulers, you can be the office party-cipant who never forgets a single cake, balloon, or awkward rendition of
    • Convert a message on Cliq into a task on Zoho Connect

      Message actions in Cliq are a great way to transform messages in a conversation into actionable work items. In this post, we'll see how to build a custom message action that'll let you add a message as a task to board on Zoho Connect. If you haven't created
    • Cliq Bots - Post message to a bot using the command line!

      If you had read our post on how to post a message to a channel in a simple one-line command, then this sure is a piece of cake for you guys! For those of you, who are reading this for the first time, don't worry! Just read on. This post is all about how
    • Cliq Bots - How to make a bot respond to your messages?

      Bots are just like your buddies with whom you can interact. They carry out your tasks, keep you notified about your to-dos and come in handy when you need constant updates from a third party application.  So, how can you make your bot respond to a message? The bot message handler is a piece of code triggered when a message is sent to the bot. Message handlers help you customise your bot responses to make it look conversational. The message input from the user can be either a string or an option selected
    • Cliq Bots - Get notifications about any action on an application with the incoming webhook handler!

      Webhooks can be used to get notified about events happening in other applications inside Cliq. All bots in Cliq have their own incoming webhook endpoint. This makes it simple to post messages to the bot from external applications. Unlike the send message
    • Recent Topics

    • Duplicate Contacts - how to get merge or delete

      I have noticed that our list of contacts in Zoho Desk duplicates contacts periodically.  I have yet to identify when or why.  How do I merge or delete them?  I see there is a "Deduplicate" but I am unable to find anything that explains this feature.
    • Admin Access to Direct Messages in Zoho Cliq

      Hi Zoho Cliq Team, We would like to request a feature enhancement to enable admin access to one-on-one conversations (direct messages) conducted through Zoho Cliq. Use Case: As administrators, there are situations where it becomes essential to access
    • "Mark as Spam" not working as expected

      Dear support, in the below scenario, clicking on "Mark as spam" identifies only the first of the checked emails as spam, removes that email from the visible list and leaves the rest of the list still visible & unchecked. I've tried check-marking them
    • Massive price increase for user licenses of Zoho Portal

      This actually a complaint about this announcement: https://help.zoho.com/portal/en/community/topic/free-user-licenses-across-all-portal-user-types You present this as an enhancement. And, yes, while reading the main part, I'd agree that (for smaller companies),
    • Elevating Email Security on Zoho Desk: DKIM Now Mandatory

      Hello Zoho Desk Users! It has been a wonderful journey with you on Zoho Desk. As we welcome 2025, we are strengthening our efforts to ensure a secure and seamless experience for you. To enhance email security, DKIM configuration will be mandatory for
    • Free user licenses across all Portal user types

      Greetings everyone, We're here with some exciting and extensive changes to the availability of free user licenses in CRM Portals. This update provides users with access to all Portal user types for free to help them diversify their user licenses and explore
    • Calendar - "super compact" week view

      every time i go to my calendar i have to re-engage the "super-compact view" for the week view...is there a way to make "super-compact" a default view so I dont have to keep on setting it manually?
    • Calendar - "pop up" locations

      One of the attractive features of google calendar and outlook calendar is that locations for events will start to automatically populate the location drop down menu as you type. Adding this feature to zoho calendar would be the final feature i need.
    • Using Zia in Zoho Sheet data to research the internet and return answer to a cell in Zoho Sheet

      I'm trying to see if Zia (connected with OpenAI key) can take data parameters stored in a Zoho Sheet to conduct research out on the internet then return an answer into the same Sheet. I'm trying to do the equivalent of using something like the =AI() function
    • [Free Webinar] Learning Table Series - Creator for the Education Industry

      Hello Everyone! We're thrilled to invite you to the Learning Table Series—a year-long initiative to demonstrate how Zoho Creator can transform industries with innovative and automated solutions. Each month focuses on a specific industry, and this time,
    • Remove the [## XXXX ###] from subject replies

      For our organisation we would like to have the [## XXXX ###] removed from subject replies. Cheers, Jurgen 365VitaalWerken
    • Self Client Authorization Issue

      Hi. Trying to test the api integration for Zoho Desk with the Self Client - Client Credintials flow method. I've created the self client, obtained the client id and secret, inputted "Desk.tickets.ALL" as my scope, and "ZohoDesk.[My Zoho Desk Org ID]"
    • Recurring Events Not Appearing in "My Events" and therefore not syncing with Google Apps

      We use the Google Sync functionality for our events, and it appears to have been working fine except: I've created a set of recurring events that I noticed were missing from my Google Apps calendar. Upon further research, it appears this is occurring
    • How Can I Easily Access and Manage My GEPCO Online Bill Using Zoho Sheets?

      Hello everyone, I'm looking for an efficient way to access and manage my GEPCO online bills. I've heard that Zoho Sheets can be a powerful tool for organizing and tracking bills, but I'm not sure how to set it up for this specific purpose. Does anyone
    • All notes disappeared

      I've been using the notebook app for over five years on my phone without being logged into an account. A few days ago I opened the app and all my notes had disappeared. Since then I tried restarting my phone, updating the app and logging into my account,
    • How to add tags to a record with jS SDK 1.2/ZohoEmbededAppSDK

      Hello Is it possible to add tags to a record with jS SDK : https://live.zwidgets.com/js-sdk/1.2/ZohoEmbededAppSDK.min.js ZOHO.CRM.API.updateRecord Thanks for insights
    • URGENT: Zoho Forms reCAPTCHA v2 Spam Issue

      Hello Everyone, We are encountering a critical issue with Zoho Forms despite having reCAPTCHA v2 enabled. Our business is accessibility-focused, and we are receiving a high volume of spam submissions, which is significantly affecting our workflow and
    • View all Products by pipeline deal

      Very good CRM I use it everyday only problem is modules not being interconnected especially products module. The main problem of products module are separated from contacts and company modules and only being connected to the Deals module. This way there's
    • Add "Lead Image" in Bulk?

      Each of our Leads is accompanied with a URL containing a photo of the lead when they come in. We currently have to manually download then upload the photo to the lead. This is a HUGE waste of time. Is there any way to AUTOMATICALLY add the photos to the
    • Map fields from CRM record to Finance Suite/Books Invoice fields

      I'm trying to auto-fill unique record specific field inputs that I have in my Contacts and Deals modules onto Invoices created from the record's finance suite related list upon creation.  One example is a field called "Job Number" that I have in my Contact
    • Add and Remove Agents from Departments and Groups in Zoho One

      Hi Zoho Flow Team, We hope you're doing well. Currently, Zoho Flow provides an action to add an agent to a group in zoho one, but there is no action to remove an agent from a group or a department. Another action that we find missing is the option to
    • Zoho CRM - best way to search an account and assign to a deal

      Hi Everyone I am looking for some advice. I want to find the best way to complete the below steps. We have a deal and once it reaches a certain stage we need to allocate a supplier / vendor to this deal along with the salesperson. I want to add (ideally
    • What's New in Zoho Analytics - December 2024

      Hello Users! We’re excited to bring you a roundup of the latest features and improvements in Zoho Analytics. These updates are designed to elevate your data analytics experience, making it more powerful, interactive, and seamless. Let’s dive in! Expanded
    • trying to access CRM Variables with JS SDK

      Hello i built a widget with Sigma, i create CRM VARIABLES in custom properties. I try to access them in function : ZOHO.embeddedApp.on("PageLoad",function(data) with : ZOHO.CRM.CONFIG.getVariable("mycrmvariable").then(function(data){ console.log("mycrmvariable
    • How to Assign Record Ownership in a Custom Form via API?

      Hello everyone, I’ve created a custom form in Zoho People and I’m using the API to manage its records. I would like to know how I can assign ownership of these records to specific users via the API. Is there a specific parameter or field in the API request
    • Writing on sketch cards is bugged when zoomed in

      When zoomed in, it writes a noticeable distance above or to the side of where you're actually trying to write. The further you're zoomed in, the more noticeable it is. Zooming is also entirely absent on the desktop version.
    • Private Project

      Hi, I would like to know if a user can create a Private project that only he's able to see it. Not even the ADMIN user. Thanks
    • Apple Messages for Business in Omnichannel communications?

      Hello, Apple launched "Apple Messages for Business" but Zoho CRM or Zoho Desk don't appear in the list of possible integrators. Zoho already promotes https://www.zoho.com/crm/omnichannel.html Omni Channel integration, but Apple Messages does not yet appear.
    • Accordion in tabs to create FAQs, etc.

      Accordion elements do not seem to be able to be placed in the tabs. It would be useful to be able to do this. Thank you.
    • Which are the IP addresses to use for 'split delivery' with Office 365? (Zoho mail inbound gateway)

      Hi, I'm trying to set up 'split delivery' (email routing) with Office 365. I'm following the instructions to set up Office 365 as the primary server (https://www.zoho.com/mail/help/adminconsole/coexistence-with-office365.html) One of the prerequisites
    • Zoho Projects 2024 Recap

      Dear Users, As we conclude another remarkable year, it's the time to reflect on the journey we've just completed. The year 2024, defined by significant milestones, challenges, achievements, and important lessons. Every moment has contributed to the story
    • Custom Fields at Line Level

      Hi, is there an ability to add custom fields at line level? I need to track the start and the end date for each product within an invoice and I can't seem to find an option to do this.
    • Zoho API Error Code 7019 when adding job.

      Hello, I am following the documentation found here. https://www.zoho.com/people/api/timesheet/adding-jobs.html Regardless of how I try and post the data (including just using the example requests), I receive back the response {'response': {'message':
    • How to see changes with ZOHO.CRM.API.updateRecord(config) without reload page

      hello got a widget in account, trigger with a button i copy data to account when click on a button, in my popup All is working well. But i need to reload the page to see the update. How can i see the changes without reloading page, only when close the
    • How to call a Creator function which is in a different Creator application?

      How to call a Creator function which is in a different Creator application?
    • Unable to send message; Reason: 554 5.1.8 Email Outgoing Blocked

      My account is mino@flawless-frames.com, or flawlessframesstudio@gmail.com Could you please unblock my account, I've got restricted from sending more emails
    • Stock Count

      The stock count is a nice new feature, but we cannot figure out how to: 1. Use it without assigning to a person, we have a team or one of multiple do stock counts as do most any company. 2. Add any extra fields to what the "counter" sees. The most important
    • If I turn off the Task Prefix & ID in the Portal Configuration section, will it remove the dependencies in my projects?

      Hi all, basically the title, I am new to zoho projects and trying to get my head around some basic principles. Unfortunately I have not found this information via the search option and after deleting yesterday some Phases I had created in the Phases tab,
    • Move a Contact from Current Account to a NEW Account

      I do not believe the functionality to Move a Contact from a Current Account to a New Account is not available. Please someone tell me I am missing something! I have been through designing, developing, using and selling CRM systems for over 25 years and had this functionality20+ years ago in other CRMs.  In the real world people move from one organisation to another. In the sales, finance and technical world it is nice to see the communication history with that person in their old account and also
    • Force Specific Layout for CRM Contacts Portal

      Hello: We're in trial on ZOHO One and looking at the CRM Portal (just for the contacts module). We have a client layout set up for Contacts that is working well for our internally, but for the portal we don't want to require (make mandatory) some of the
    • Next Page