Creating an entry with a public facing form

I have a project where the client wants external users to be able to submit draft entries to a contentful space through a public form on a static website without signing up for an account. Is there any way to do this?

Hi @tekd,

It would be fairly straightforward to do what you described: you could choose one of our SDKs and utilize the Management API in your application to programmatically create these entries.

However, you should do so with caution at the level of your application, as you wouldn’t want to expose your Management token to external users, as that would be a considerable security concern.

Hello @tekd,

Basically what you need, is a small Sinatra, Express.js etc. application running on your own server or on Heroku etc.

Your application needs to have a end-point like https://yourdomain.com/form-submit which responds to POST-method. That end-point will handle the incoming POST-data from the form, which is sent like this:

<form action="https://yourdomain.com/form-submit" method="POST"><!-- Fields --></form>

Your application includes the management token, so it’s not exposed publicly. When the application receives POST-data from the form, it processes the data and sends it to Contentful via the Management API. Adding some kind of additional access token between the form and the application as well as a IP-whitelisting is highly recommended.

If you already have some kind of front-end displaying content from Contentful, it would make sense to integrate the form handler end-point as part of that website.

2 Likes