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

    • Adding tag to specific record as an acion in a workflow

      Hi! I've created the following workflow in the module 'Leads'. When a record meets the criteria, there should be a tag added to the specific record in the module 'Contacts'. In the module 'Leads', there is a look-up field named 'Kandidaat' which is connected
    • How to query for Deals record based on Pipeline?

      I want to query for Deals records that matches a specified Pipeline using a Deluge function. When I call zoho.crm.searchRecords("Deals","(Pipeline:equals:" + myPipeline + ")"), I get this error: { code: 'INVALID_QUERY' , details: {...} , message: 'Invalid
    • CRM formula field help

      Hello! i was hoping to get some help with a formula i'm creating within a module. I'm looking to make a formula that changes based on a date field but based upon the present date. This is the formula i have so far: If(Now() < ${Instructors.Start Date},
    • Change to copy/paste functionality in Deluge code editor

      Recently there was a change to the Deluge code etidor where it now inserts backslashes into strings automatically when copying/pasting strings with double quotes, it's a nightmare to have to go delete all these. Is it possible to toggle this on or off?
    • ChatGPT only summarize in English

      Hello i' v enabled chatgpt in salesIQ, it works great inside conversation (revise, Rephrase etc) add tags works well with another language than English. But when I want to summarize it render only in English, despite sales IQ is set to another language.
    • Chart with Filtered Data vs Unfiltered Data

      I am looking to create a chart view that displays the full data set vs a subset of the data filtered by user filter. However I do not seem to find any method by which to exclude a plot from the applied filter or any other method by which to display the
    • BIN Locations

      Hi, I’m new to Zoho inventory and unless Im missing something, I cannot find BIN locations anywhere in ‘items’? please tell me it’s there somewhere?!? Thanks
    • Can't verify domain with AWS Route53

      I have a domain successfully transferred to AWS Route53 from NameCheap. When I try to CNAME or TXT Records as suggested, they are added in AWS console however zohomail does not verify them.  For the TXT record zohomail says the value is wrong, whereas for CNAME record zohomail can't find any CNAME record. I don't know what to do! 
    • BANK FEED - MAYBANK , provider from YODLEE IS NOT WORKING

      As per topic, the provider YODLEE is not working for the BANK FEED. It have been reported since 2023 Q3, and second report on 2023 Q4. now almost end of 2024 Q1, and coming to 2024 Q2. Malaysia Bank Maybank is NOT working. can anyone check on this issue?
    • Create a custom button to modify custom fields in zoho Inventory

      I am needing a script for two buttons, 1. Button will add todays date to a custom field named cf_sent_to_sov 2. Button will mark a checkbox or unmark a checkbox field named cf_parts_ordered I have been trying to figure out deluge but have not got anywhere
    • Canadian payroll

      Hello ZOHO, is any updates on when payroll for Canada will be available?
    • Default reminders on Emails

      I have seen that it is possible to set, for each email, a reminder when the email remains unresponded for some time. This is very useful, so useful that I would like to set it for all my emails, by default. Because an unanswered email usually requires
    • Update Department on Ticket (with applied Blueprint)

      Hello, Is it possible to update the Department of a ticket which is dictated by a blueprint, e.g. I would like to change departments at different states in the Blueprint. I do not see this is an option in workflow rules or blueprint transition actions,
    • in zoho assist I would like to temporarliy go into view only mode

      During a zoho assist remote support / remote control session, I would like an option to turn off control, and go into view only mode. Then later, turn back on control, all within the same session. (Many other remote login apps have this feature.) For
    • Issue Configuring SSO Integration with Cognito in Zoho Help Center

      Dear Zoho Support Team, We have been working on configuring SSO integration for our Zoho Help Center using Amazon Cognito. While the setup appears to be completed successfully, we are encountering an issue when attempting to access the Help Center. The
    • QR code image is not exported in PDFs

      The new QR code field works fine when I include it in a report template and I choose the print option: https://creatorapp.zoho.com/<username>/<app_link_name>/record-print/<report_link_name>/<record_ID>/ But when I try to save the document to a .pdf file
    • Zoho notes list issue

      Hi team, Suddenly my extension is not working and I could not find the extension in my marketplace list anymore. Extension version deprecated This version of the extension is no longer in use. Please update the extension and try again.
    • Assignment Rule: Immediate Ticket Assignment to Agents Upon Shift Start

      Dear Zoho Desk Team, I hope this message finds you well. Currently, when the option to assign tickets to offline agents is turned off, agents who come online during their shift have to wait for about 30 minutes before any tickets from the queue are assigned
    • Change email template depending on answer from form

      Is it possible to set up the following in Zoho Desk: When a user submits a ticket via the Zoho Help Center's form, they can select an answer from a dropdown field. In this example, the dropdown options are 'Option A' and 'Option B.' If a user selects
    • Kaizen #171: FAQs on COQL API

      Hello all!! Welcome back to another post in the Kaizen series! In this post, we will address some of the most frequently asked questions about Zoho CRM's COQL API from the Zoho CRM Developer Community Forum. COQL API Query API lets you query for records
    • Issue with Date Placeholder Formatting in Ticket ID Customization

      Hello Support Team, I'm experiencing an issue with the date placeholder formatting in Zoho Desk's Ticket ID customization. Specifically, when using the `{{DD}}` placeholder for the day in the prefix or suffix, the output displays the day as a single digit
    • Time Field

      Good Day, I have a question, when I save a draft and reload it. Why does the time field format keeps goes from hh:mm to hh:mm:ss? Is there a way I can force it to load to hh:mm only? I have tried example = totime(input.TimeField, "hh:mm") in the -created
    • Zoho CRM Widget and translations

      Hi everyone! We're building a Widget with zoho-extension-toolkit, how is localization supposed to work? "zet init" created a translations/en.json file, but what should go inside it and how is it supposed to be accessed from the Widget/javascript? Thanks
    • Feature Req - See imap emails in Timeline tab of a deal

      In many other CRMs such as pipedrive and hubspot, when you are looking at the timeline of a deal you can also see snippets of emails that have been sent or received and then click to view the full message. This gives users a fast way to catch up on EVERYTHING
    • HOW TO: Searching a thread (email body/text) with a custom function, allowing filtering and specific actions

      We are still trialing out Zoho at this time, but have found a major expected feature to be missing - the ability to search within the text of an email for automation/workflows. NOTE: You need to create a connection for zohodesk under settings -> Developer
    • Partnership Proposal for Supporting Number Porting Services in Singapore

      Dear Zoho Representative’s, I hope this message finds you well. My name is Honelito Gilos, and I represent Borderless Hub Pte Ltd (Singapore). We are a Telco here in Singapore specialising in providing seamless number porting services, and I’m reaching
    • Tip #2: Prefill forms automatically with existing Zoho CRM data

      How to automatically prefill a form with existing Zoho CRM data? Prefilled forms can be useful when you want your prospects to view and confirm their data, and in a wide range of other situations. In Zoho Forms, we prefill the fields with the values from Zoho CRM using the Zoho CRM field. What is a Zoho CRM field? A Zoho CRM field acts as a two-way communication channel, by sending data to Zoho CRM from forms and fetching information from CRM into Forms. The field will look up data from your CRM
    • Pushing GCLID info from Gravity Forms to ZohoCRM

      We are switching to Gravity Forms from Zoho Forms and I cannot find any good info on how to make sure my GCLID tracking info is pushed through to the CRM through my new forms. There was an article in the documentation about placing something within the
    • Organization Variables - Restrict Access

      Currently, there is no way to restrict the access to organization variables. This leads to a problem when storing API related values that should be kept secret as anyone with access to create and edit email templates, workflow rules, or inventory templates
    • 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),
    • Transform Your Customer Support with AI-Powered Chatbots in Zoho SalesIQ

      Ever wondered how some companies seem to have superhuman customer support? Let's uncover their secret! In the digital age, customer expectations are skyrocketing. Did you know that according to McKinsey, 75% of consumers expect a response within five
    • Quickbooks conversion and Internet sales

      Hello, we are considering converting from Quickbooks enterprise to Zoho Books and using MonotorZ for our mrp needs. Today we import Internet sales under a single customer with multiple ship to addresses. We want to maintain the detail in CRM for marketing
    • KPI widget with percentage

      I'm trying to create a KPM widget that displays current performance as a percentage - something like the picture below. I've tried following the instructions at https://www.zoho.com/analytics/help/dashboard/kpi-widgets.html#chart but nothing ends up being
    • How to add two columns in Zoho forms

      I would like to have two columns in Zoho forms. How can i enable two columns?
    • When creating Sales Order / Estimate via API, the line item Tax Code does not get pulled in.

      I'm creating Sales Orders via API from CRM but it does not pull in the "Tax Code" I've read within the forums that this should be done automatically but it's not happening. Not sure if it's a bug or by design? Anybody else know? Should we be adding the
    • Chart showing schedule

      I want to be able to create a chart for everyday to check and which of which driver is available on the timeframe. Here's my table Name City Day Start Time End Time Driver1 Medicine Hat Monday 11:45 AM 4:45 PM Driver 2 Medicine Hat Tuesday 11:00 AM 7:00
    • Running Total % in Pivot with filters

      Hi there, I have seen a few posts on this topic, but i cant seem to find one that will work when applyig filters to the data. I have Rows and Data in a pivot view I want to show the running total of revenue as a % of the total for the data set. If i add
    • Quais são os maiores desafios que você enfrenta ao implementar o Zoho CRM?

      Olá, pessoal da comunidade Zoho Brasil! Sou parceiro autorizado da Zoho e, ao longo do tempo, tenho notado que cada implementação de CRM traz desafios únicos, dependendo do segmento de negócio, das metas da empresa e até da familiaridade da equipe com
    • 2025 Just Got More Exciting for Developers!

      Hello, Greetings to the Zoho Books Community! As we step into the New Year, we're thrilled to roll out something truly special for our Zoho Finance enthusiasts – the "Zoho Finance Developer" Community! This is your exclusive space to connect with fellow
    • Error in executing On user input script

      I'm having problems with this  this script : ; Tipo_list=List(); Tipo_rec = Tabla_factores[Periodo == input.Periodo_anos.toLong()]; Tipo_list.addAll(Tipo_rec.Clase_credito.getall()); for each Clase_credito in Tipo_list { Tipo_credito:ui.add(Clase_credito) } Error in executing On User Input script of Periodo en años. Error. Error in executing Fetch Record task. Unable to fetch Tabla_factores and update variable Tipo_rec. Error in evaluating the criteria : Error. Error evaluating NUMERIC expression
    • Next Page