If I use cfdump / deserializeJSon to review the 'JSONData' variable, it outputs just fine. I've been looking at this all day, so I might well be missing something that's staring me in the face.
<cfsavecontent variable="JSONData"> { "data": { "Last_Name": "Smith", "First_Name": "John", "Email": "john@smith.com", "Phone": "0123456789", "Lead_Source": "PPC", "Build_Cost_text": "50", "Estimated_Sales_Value": "100", "Stage_of_Build_Work": "Not Started", "Work_Starting_Date_text": "01/06/2021", "Number_of_Units": "1", "Address_of_Development": "123 Any Street", "Gross_floor_area_m2": "100", "Development_Use": "Self Build", "Please_share_any_additional_information": "Just testing stuff", "Company": "Smith Widgets" } } </cfsavecontent> <cfhttp method="POST" url="https://www.zohoapis.com/crm/v2/Leads" result="zohopostresult"> <cfhttpparam type="header" name="Authorization" value="Zoho-oauthtoken #gettoken.access_token#"> <cfhttpparam type="header" name="content-type" value="application/json" /> <cfhttpparam type="body" value="#JSONData#" /> </cfhttp>
The error returned using the above code is;
{"code":"INVALID_DATA","details":{"expected_data_type":"jsonarray","api_name":"data"},"message":"invalid data","status":"error"}
If I use cfdump / deserializeJSon to review the 'JSONData' variable, it outputs just fine. I've been looking at this all day, so I might well be missing something that's staring me in the face.