How to get Zoho API access and refresh token (Zoho Developer Console)

In this video, we go over how to set up an account with the Zoho API developer console, get API keys, access and authentication tokens, and common GET and POST requests.

If you are more of a visual learner check out my video:

1) Create Client Name in Zoho Developer Console

Sign in to Zoho. If you do not already have an account, you need to create one.

Next, go to the Zoho Developer Console and create a new client. Select ‘Server-Based Applications’ and fill out the rest of the fields:

-Client Type: Served-Based Applications
-Client Name: sgwptest (add any name you would like)
-Homepage URL: yourdomain.com/
-Authorized Redirect URI: https://yourdomain.com/

Before proceeding to make your authorization request, make sure that you have the Postman API client downloaded and open. Zoho provides a short-timed grant code that expires after a minute so super important to have Postman ready to go.

2) Send Authorization Request

Next, we need to send an authorization request to Zoho Accounts. During this step, we want to pass the ‘scope’ of what we will grant this Client access to. Since we want the client to be able to subscribe to users, update users, edit users, and delete users in Zoho Campaigns, we include the scope ZohoCampaigns.contact.ALL.

Using your client ID, client secret, and redirect URI, send an authorization request in your web browser to Zoho Campaigns.

Here is a sample url below that you can replace with your values:

https://accounts.zoho.com/oauth/v2/auth?response_type=code&client_id=1000.1FLIPW3X5540NLWM8AKIF20CJVGODH&
scope=ZohoCampaigns.contact.ALL&redirect_uri=https://sgwebpartners.com/&access_type=offline

Approve your request and copy the grant code into your web browser.

3) Generate Access Token & Refresh Token

Open up Postman and enter in the following URL (edit your parameters for code, client ID, client secret, and redirect URI. Here is an example:

https://accounts.zoho.com/oauth/v2/token?code=1000.e93961d10d1db8a46deadbe09941ce0a.0c7a271ad48952677d2075930e3e67d0&client_id=1000.1FLIPW3X5540NLWM8AKIF20CJVGODH&client_secret=fe119bb4fe941e19535798ae2cfebb2e20796f3bcc&redirect_uri=https://sgwebpartners.com/&grant_type=authorization_code

You will be provided your access token, refresh token, etc.

4) Use Access Token to make your first POST request

https://campaigns.zoho.com/api/v1.1/json/listsubscribe?resfmt=JSON&listkey=[listkey]&contactinfo=%7BFirst+Name%3Aandrew%2CLast+Name%3Amiller%2CContact+Email%3Atest9%40sgwebpartners.com%7D

5) Subscribe user to list in Zoho Campaigns

Params:

resfmt: JSON
listkey: 58c3908e47768243dbc9a9dbcf4d1bb07461b395c6e88487
contactinfo: %7BFirst+Name%3Aandrew%2CLast+Name%3Amiller%2CContact+Email%3Atest9%40sgwebpartners.com%7D

Headers:

Authorization: Zoho-oauthtoken {insert code}
Content-Type: application/x-www-form-urlencoded

I would recommend using a test email of yours. If successful, you will see a message like this:

{
"code": "0",
"message": "A confirmation email is sent to the user. User needs to confirm to successfully subscribe.",
"version": "1.1",
"uri": "/api/v1.1/json/listsubscribe",
"status": "success"
}
Simon Gondeck

I’m a big fan of WordPress + WooCommerce (especially WooCommerce Subscriptions). Check out my YouTube channel.

2 thoughts on “How to get Zoho API access and refresh token (Zoho Developer Console)”

  1. Trying to find this video with a non blurry readable view of your text file. No luck anywhere. You give examples in the text but cut each line in half and show … .
    Still no idea what those look like

    Reply

Leave a Comment