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 Desk Resources

                            • Desk Community Learning Series


                            • Digest


                            • Functions


                            • Meetups


                            • Kbase


                            • Resources


                            • Glossary


                            • Desk Marketplace


                            • MVP Corner


                            • Word of the Day



                                Zoho Marketing Automation


                                        Manage your brands on social media



                                                Zoho TeamInbox Resources

                                                  Zoho DataPrep Resources



                                                    Zoho CRM Plus Resources

                                                      Zoho Books Resources


                                                        Zoho Subscriptions Resources

                                                          Zoho Projects Resources


                                                            Zoho Sprints Resources


                                                              Qntrl Resources


                                                                Zoho Creator Resources


                                                                  Zoho WorkDrive Resources



                                                                    Zoho Campaigns Resources

                                                                      Zoho CRM Resources

                                                                      • CRM Community Learning Series

                                                                        CRM Community Learning Series


                                                                      • Tips

                                                                        Tips

                                                                      • Functions

                                                                        Functions

                                                                      • Meetups

                                                                        Meetups

                                                                      • Kbase

                                                                        Kbase

                                                                      • Resources

                                                                        Resources

                                                                      • Digest

                                                                        Digest

                                                                      • CRM Marketplace

                                                                        CRM Marketplace

                                                                      • MVP Corner

                                                                        MVP Corner

                                                                      





                                                                      




                                                                          Design. Discuss. Deliver.

                                                                          Create visually engaging stories with Zoho Show.

                                                                          Get Started Now