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