Is it possible to post a form to Sprout Forms in Craft 2 from a desktop app or another website?

The AJAX example in the docs mentions this - sproutForms/entries/saveEntry What would the full URL be?

I did try http://domainname.com/sproutForms/entries/saveEntry but it gives an 404 error.

Thank you for reading this.

Assuming you're using a hidden action input, then sproutForms/entries/saveEntry should be correct. You can see that in the Craft docs here: https://docs.craftcms.com/v2/plugins/controllers.html#posting-to-controller-actions

If you're not using that input, or you're constructing the URL to post to manually, then it will likely be actions/sproutForms/entries/saveEntry instead, assuming you have set a custom actionTrigger in your general config.

  • How would CSRF support play out in a request to Craft from another website? As far as receiving the data, I expect as long as it comes in the right format, it'd be received fine. However, is there a way to pass a valid csrfToken to Craft in a third-party post request, or anything we have to do within the plugin to work around that? – Ben Parizek Oct 24 at 19:00
  • Gah, sorry @BenParizek. Glanced over the fact it's about posting to another website/app. CSRF is tied to session so it'd be difficult. – Brad Bell Oct 27 at 21:48

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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