Input could not be converted to a valid request

I submit this curl request …

curl -X POST -H “Accept: application/json, /” -H “Content-Type: application/json” -H “Authorization: Bearer my.access.token” -d ‘{“email_addresses”:[{“email":"azook@aspireokc.com”,“field”:“EMAIL1”}],“given_name”:“Andy”,“email_status”:“SingleOptIn”,“family_name”:“Zook”}’ https://api.infusionsoft.com/crm/rest/v1/contacts

And I get the following reply …

{“message”:“Input could not be converted to a valid request”}

However, I can paste the data into the InfusionSoft API reference “try” area, it works fine. What am I missing?

So that message indicates that the json is malformed. Can you post the json you’re submitting so we can take a look for you?

It is listed in the original post. But I have since discovered the issue. I need to escape the double quotes in the data portion of the request and use double quotes instead of single quotes. Correct line looks like this …

curl -X POST -H “Accept: application/json, /” -H “Content-Type: application/json;charset=UTF-8” -H “Authorization: Bearer my.access.token” -d “{"email_addresses":[{"email":"azook@aspireokc.com","field":"EMAIL1"}],"given_name":"Andy","email_status":"SingleOptIn","family_name":"Zook"}” https://api.infusionsoft.com/crm/rest/v1/contacts

1 Like

Woops, sorry, I did mis that you posted it. Yes, escaping or sub-parse building is really the only way. But glad you got it worked out! :wink: