<p>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:
<a href="https://github.com/barrelstrength/craft-sprout-forms/issues/319" rel="nofollow noreferrer">https://github.com/barrelstrength/craft-sprout-forms/issues/319</a></p>

<p>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.</p>

<p>For integrations with a specific platform that may require specific settings, it's Sprout Forms does have an <a href="https://sprout.barrelstrengthdesign.com/docs/forms/custom-integrations.html" rel="nofollow noreferrer">Integrations API</a> where you can add your own custom Integration for an editor to select and use.</p>

<p>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.</p>

CC BY-SA 4.0
2019-07-22T13:04:21.437Z
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.
Phil Richards
CC BY-SA 4.0
2019-07-19T23:44:40.963Z
2019-07-19T23:44:40.963Z
Ben Parizek
<p>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. </p>

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

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

<plugin-sproutforms>
Changing Content-Type on Sprout Forms custom endpoint
# Changing Content-Type on Sprout Forms custom endpoint

(Asked by: username_0 on 2019-07-19)

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?

**Tags:** plugin-sproutforms

---

## 1 answers

### Answer by username_1 on 2019-07-19. Score: 0 | Accepted answer

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](https://sprout.barrelstrengthdesign.com/docs/forms/custom-integrations.html) 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.

> **Comments:**
> **username_0**: 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.  

---

