Unable to get Catalyst API access_token

Unable to get Catalyst API access_token

I am trying to get a working example by following the instructions here:

I registered a new "Self Client" and got client_id and client_secret. Then I generated a grant_token as described there.
I then attempted to get the access_token and refresh_tokens as described. I am using Python to send the POST and GET requests. Here is my code.

import requests
url = 'https://accounts.zoho.com/oauth/v2/token'
data = {
'code': grant_token,
'client_id': client_id,
'client_secret': client_secret,
'grant_type': 'authorization_code'
resp = requests.post(url, json=data)

But it didn't work. I then tried the following code and I get an {'error': 'invalid_client'} response.

import urllib
import json
params = f'code={grant_token}' \
f'&client_id={client_id}' \
f'&client_secret={client_secret}' \
bin_params = params.encode('utf-8')
req = urllib.request.Request(f'{url}?', data=bin_params)
response = urllib.request.urlopen(req)
result = json.loads(response.read())

I am stuck. How can I get this to work?

    • Announcements

    • Important Announcements in Support for Catalyst Features

      Hello Catalyst Users, This announcement is to bring to your notice some of the recent updates in our support for various Catalyst components, to ensure that your existing Catalyst applications function properly. You can continue to build robust applications
    • Introducing Catalyst 2.0, the simplest cloud-based pro-code development platform.

      Dear Catalyst Community, We are beyond thrilled to present you Catalyst 2.0—the new-age, pro-code development platform that redefines the way you build, deploy, and scale apps. Catalyst 2.0 is not a mere upgrade, but a significant leap into the future
    • Set budgets to optionally disable your Catalyst production environment

      Hello all,    We are pleased to inform you that you can now configure the automatic disabling of a project's production environment upon reaching a specified budget's threshold. Budget alerts in Catalyst facilitate setting usage limits in amounts or Catalyst
    • #CatalystServerless Hackathon 2022

      We are pleased to announce #CatalystServerless Hackathon with prizes worth $5000 up for grabs. Create a working prototype aimed to solve a critical business issue using Catalyst and stand a chance to win exciting prizes. The Hackathon will happen in 3
    • Share your interest to participate in the #CatalystServerless Blogathon

      Hi, we are working on announcing the next edition of the #CatalystServerless Blogathon. Please fill up this form to stay posted on all updates related to the Blogathon. https://zfrmz.com/JN9ChxPU9JQpPgB1vRp8

      Catalyst Community