2

I'm using Sprout Forms 3.3.7 and have created a custom endpoint integration to post the form data to Pardot. The integration fires successfully, but Pardot was rejecting the request.

I used Guzzle Middleware to inspect the request (right around here https://github.com/barrelstrength/craft-sprout-forms/blob/v3/src/integrationtypes/CustomEndpoint.php#L83) and it tells me that the Content-Type is application/json but Pardot only accepts application/x-www-form-urlencoded.

Is it possible to change the Content-Type when using a custom integration? Either in the CP or in the form.twig code?

0

The Custom Endpoint integration currently is sending JSON as the request, but we could consider adding additional options there. I've opened a Feature Request if you'd like to add any more details there: https://github.com/barrelstrength/craft-sprout-forms/issues/319

In general, the Custom Endpoint is best used when you control the other end of the request and control how you are receiving the data there. While it's possible that the Custom Endpoint can work with specific platforms, there may be several other considerations that will need to be addressed as you work toward a successful request such as authentication and the format of the fields being sent in the request - and in several cases, it may not be possible at all with the default settings or may require some additional configuration updates to get those things working.

For integrations with a specific platform that may require specific settings, it's Sprout Forms does have an Integrations API where you can add your own custom Integration for an editor to select and use.

In your case, that could mean that you create a Pardot Integration, configure your Pardot API credentials within your Craft and Integration module settings, and have the integration call out to the Pardot API to present the user fields or options that are retrieved from your Pardot account directly.

1
  • Thanks for the clarification. This seems much more involved than the previous version of Sprout Forms, where we could just use payload forwarding to get the data into Pardot. Is there no alternative to this now beyond creating our own integration? Alternatively, is there a way to get an Integration ID based on the Form ID? If I modify the submit action of the form I can post directly to the integration, even though that means we don't get to save an entry in the database. But that only works if I have the integration IDs. Jul 22 '19 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.