Hi, I'm trying to get an OAuth token using the API but I keep getting a 400 Bad Request error when I try to retrieve the token using the code returned. Here's an example request:
POST /oauth2/token HTTP/1.1
Host:
login.mailchimp.comAccept-Encoding: gzip, deflate
User-Agent: RSSBus Data Provider Engine -
www.rssbus.comConnection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 173
grant_type=authorization_code&client_id=xxxxxxxxxxxx&client_secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&code=d64bf9270586c4756685e483fd3decf4&redirect_uri=http%3a%2f%2f127.0.0.1
The Client Id, Client Secret, and Redirect URI are all exactly as they appear for my registered app so I'm not sure what's bad about the request. I'm using the exact same values when I make the request for the code. Do you see anything obvious that I'm doing wrong? I've tried lots of small variations of the above but I always get the same 400 error.