invalid_client error - oauth2

invalid_client error - oauth2

I am trying to use the oauth2 authentication and I am retrieving a code from the oauth/v2/auth GET request as expected but I am getting an error on the POST - here is a redacted version of my http debugging output (the XXXX represent valid client_ids and client_secrets respectively).

POST /oauth/v2/token?code=1000.d90ca8951a72fd0ebd7b2729dd280355.0c2fd305edfa6ad1600fdb787cbff8bb&grant_type=authorization_code&client_id=XXXX&client_secret=XXXX&redirect_uri=http://127.0.0.1:8080/callback&scope=Desk.tickets.READ,Desk.basic.READ&state=1523436222480536829 HTTP/1.1
Host: accounts.zoho.com
User-Agent: Go-http-client/1.1
Content-Length: 0
Content-Type: application/json
Accept-Encoding: gzip



HTTP/1.1 200 OK
Content-Length: 56
Connection: keep-alive
Content-Type: application/json;charset=UTF-8
Date: Wed, 11 Apr 2018 08:41:01 GMT
Server: ZGS
Set-Cookie: a8c61fa0dc=5f224f2ab9d067cfce10fd0b7fae48bf; Path=/; Secure; HttpOnly
Set-Cookie: iamcsr=4918e2bc-cf9e-4e09-8fba-03d6292186f0; Path=/; Secure
Strict-Transport-Security: max-age=15768000
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1

{"state":"1523436222480536829","error":"invalid_client"}

Can anyone advise me the reason it is throwing this error

    Access your files securely from anywhere









                          Zoho Developer Community




                                                • Desk Community Learning Series


                                                • Digest


                                                • Functions


                                                • Meetups


                                                • Kbase


                                                • Resources


                                                • Glossary


                                                • Desk Marketplace


                                                • MVP Corner


                                                • Word of the Day


                                                • Ask the Experts





                                                          Manage your brands on social media



                                                                Zoho TeamInbox Resources



                                                                    Zoho CRM Plus Resources

                                                                      Zoho Books Resources


                                                                        Zoho Subscriptions Resources

                                                                          Zoho Projects Resources


                                                                            Zoho Sprints Resources


                                                                              Qntrl Resources


                                                                                Zoho Creator Resources



                                                                                    Zoho CRM Resources

                                                                                    • CRM Community Learning Series

                                                                                      CRM Community Learning Series


                                                                                    • Kaizen

                                                                                      Kaizen

                                                                                    • 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


                                                                                          Zoho Show Resources

                                                                                            Zoho Writer

                                                                                            Get Started. Write Away!

                                                                                            Writer is a powerful online word processor, designed for collaborative work.

                                                                                              Zoho CRM コンテンツ






                                                                                                Nederlandse Hulpbronnen


                                                                                                    ご検討中の方