Generating Grant Token: Does it require a Cookie? What am I doing wrong?

Generating Grant Token: Does it require a Cookie? What am I doing wrong?

Trying to follow this guide: https://www.zoho.com/invoice/api/v3/oauth/#overview for generating a token, but I can't get it to work.

I am doing the following:

Step 1: Registering New Client

2. Add client server based application
3. Add in the details
- Client name: `Example`
- Authorized Redirect URIs: `https://www.example.com`
4. Get the __CLIENT_ID__ and __CLIENT_SECRET__

Step 2: Generating Grant Token

GET request in chrome browser to:

I click accept to allow the integration
It redirect to a URL like this:

Step 3: Generate Access And Refresh Token

I then open a terminal and perform a POST request with curl like this:


But it always returns {"error":"invalid_client"}. If the client was invalid, why did it pass Step 2? Is the error message incorrect? On the forum (https://help.zoho.com/portal/en/community/topic/error-invalid-clientthey)  say attach client_id/client_secret/code etc as headers, but the help docs show it as query params. Its hard to know which way to use, since API3 might be different. So should they be added as headers, query params, or as payload data? Can someone show a working curl (convert PHP code to actual curl) example of step 3 in the docs? Dost it require a cookie to be set from the browser, and hence step 3 most occur from a browser (I don't think so, but I have tried many things for hours)?

Note: I tried to convert PHP code to actual curl reponse but there are missing variable assignments.

            Zoho Marketing Automation

                    Zoho Pagesense Resources

                      Zoho SalesIQ Resources



                            Zoho TeamInbox Resources

                              Zoho DataPrep Resources



                                Zoho CRM Plus Resources

                                  Zoho Books Resources


                                    Zoho Subscriptions Resources

                                      Zoho Desk Resources

                                        Zoho Projects Resources


                                          Zoho Sprints Resources


                                            Qntrl Resources


                                              Zoho Creator Resources


                                                Zoho WorkDrive Resources





                                                    Zoho Campaigns Resources

                                                      Zoho CRM Resources

                                                            Design. Discuss. Deliver.

                                                            Create visually engaging stories with Zoho Show.

                                                            Get Started Now