I am getting an error while calling the InfusionSoft REST API and am at a loss as to the reason.
My CLIENT_ID is the 24 character "Key" as shown in https://keys.developer.infusionsoft.com/apps/myapps. The CLIENT_SECRET is a shorter 10 character string.
I make my initial auth call:
After approving the app I get redirect to my url where I perform a POST request for an access token:
method: 'post',
url: 'https://api.infusionsoft.com/token',
data: '{"client_id":"CLIENT_ID","client_secret":"CLIENT_SECRET","code":"CODE_RETURNED","grant_type":"authorization_code","redirect_uri":"REDIRECT_URL"}'
I use axios
to perform request. It is returning a 401 with this message:
{ error: 'invalid_client' }
Any idea what this means?
Ok. I needed to stringify the params. Here's my axios call: