Can you confirm that the Content Type should be application/json?
I found the /formsnext/multipart URL in the code for this form - Form. It appeared that the form was posting to that URL, so that’s what I tried using.
Also, just to be clear, would either the v2 or v3 endpoints work for the same form (assuming I’m not using Ajax)? Or is there a setting with the form that dictates which endpoint is able to be used? Sorry, I’m new to a lot of this!
Good to know, @Matt9! It seems the “public” form URL uses a different endpoint. For your purposes, you should use the URLs specified in our developer documentation.
Yes, I can confirm the v3 endpoint uses the Content-Type application/json. The v2 endpoint, on the other hand, uses application/x-www-form-urlencoded.
Finally, yes, either the v2 or v3 endpoints will work for the same form. Only the v3 endpoint accepts AJAX (CORS) requests, though.
I just tried putting a test post through to the v3 endpoint for a different form and received the following error: {“status”:“error”,“message”:“Invalid input JSON on line 1, column 11: Unrecognized token ‘firstname’: was expecting ‘null’, ‘true’, ‘false’ or NaN”,“correlationId”:“a0335b16-37eb-4f2d-ba61-65aeece38634”,“requestId”:“59484d5d6ece893b3c0cdb2d3450c44a”}. The first parameter I was trying to post was firstname=John.
Post Parameters:
firstname=John&lastname=Smith&jobtitle=Marketing&company=Better Buys&email=jsmith@test.com&phone=123-123-1234&in_market=Yes&most_important_feature=Price&buying_timeframe2=Within 6 Months&asset_name=Top 15 Report&country=&company_size=250&sic_code=1234&industry=Media
Post Response
{“status”:“error”,“message”:“Invalid input JSON on line 1, column 11: Unrecognized token ‘firstname’: was expecting ‘null’, ‘true’, ‘false’ or NaN”,“correlationId”:“a0335b16-37eb-4f2d-ba61-65aeece38634”,“requestId”:“59484d5d6ece893b3c0cdb2d3450c44a”}
Sincere apologies for the delayed response. Somehow your message fell through the cracks.
You are receiving that error because your post body is formatted as a query string instead of JSON. The v2 Forms API endpoint accepts that format, but you’ll need to use a JSON-formatted body for the v3 endpoint.