Editor Interface

Hi Contentful Team :slight_smile:

We have a system which is integrated with Contentful.
We catch the Content Types from Contentful and in a few cases we add fields in it and then push back to Contentful. In one of the fields we need to edit the interface.

We send 2 API calls to Contentful, one for adding new fields and another for editing the Interface, but it does not work this way. Because of that, we found a workaround: update the Editor Interface when we receive the ContentType.Save Webhook. But somehow it does not work as well.

How should we proceed with the Editor Interface?

Hey @josegomes,

Would you mind explaining your workflow in a bit more detail?

In general, if you set up a webhook to be sending triggers whenever a content type is published, you could immediately associate that with a subsequent request to our editor interface.

Another thing is that it may take a few minutes until changes are reflected in the CMA, so your second request may need a small delay until the change in content type is perceived by our API.

Hi @gabriel

I am glad I hear from Contentful team so fast :slight_smile:

so, let me be more specific:

In our server we keep track of the Content Models existing in Contentful. We have them stored in our DB.
Then we have a command which add some new fields in a few of these Content Models based on some criteria.

One of these fields is a field that should be configured as “Checkbox” in the Editor Interface.

So, basically:
-> Add a new field to ContentType with pre-defined values
-> Send an API call to Contentful for saving these new fields
-> Send another API call to Contentful for publishing this new Content Type
-> Send another API call to Contentful for updating the Editor Interface (I also tried before the publish)

Doing as I said before, it does not work. Which kind of make sense for me because I don’t know how you process the API calls in Contentful. So I imagine there would be cases where the configuration of Editor Interface is processed before or at the same time as when the new fields are added.

Then I found a workaround and fixed this situation by doing these steps:
-> Add a new field to ContentType with pre-defined values
-> Send an API call to Contentful for saving these new fields
-> Send another API call to Contentful for publishing this new Content Type

-> Configure a Webhook handling for “publish” and then when receive this Webhook (caused by the previous script) our system configure the Editor Interface and push it back to Contentful.

so, that is how I am doing it at the moment and it is working. But I thin it is a bit too hacky…
In my opinion the best option would be to send the Editor Interface configuration together with the ContenType new fields.

I hope you guys can reproduce the problem there.

Hi @josegomes,

Thank you for the awesome explanation :grin:

If I understood correctly, in short, you’d like to pass out the Editor Interface configuration in the same request as the one that’s updating the Content Type fields, is that correct?

If that’s the case, it’s indeed not possible to do that at the moment, but I could surely open a feature request for it :slight_smile: