How I can send data to Pardot FormHandler via API. And get the JSON response as in this question: Pardot form handler submission via API?
1 Answer
You are actually mixing 2 technologies here.
Pardot's Form handler only accepts a x-url-form-encoded
payload which "returns" a URL to be redirected to. If there's a validation error at the Form Handler level, the redirect URL will contain the error details. JSON is not possible here (unless you want to pass a JSON string as a value to one of the fields)
Pardot's API is a different way to work with Pardot, and would require a little bit of coding on your end to make it work, including OAuth to get an access token and making API requests to get your data in (in a way that doesn't create duplicates).
Working with V3 or V4 of the API, you need to specify format=json
as a URL parameter to the API request. V5 of the API is JSON.
-
Maybe I misunderstood the description of the question I was referring to prnt.sc/23ocg4z, but I thought he just sent a Post request to the formHandler endpoint. If it still sent a request via the API, can I run submit formHandler via the API or not? I would like to be able to configure Completion Actions via the web interface. Commented Dec 19, 2021 at 17:44
-
A Form Handler can take a simple POST request with x-url-form-encoded content. The API can provide a JSON response. You can't submit a form handler with the API, there are no endpoints for doing so. Commented Dec 19, 2021 at 19:31
-
Pardot API and Pardot Form Handlers are completely different technologies / systems / code. Commented Dec 19, 2021 at 19:31