Update expression engine channel entry content

208 views Asked by At

I'm new to expression engine so might question might not sound right to most people.

I'm trying to update the content for a channel entry but not sure whether it's possible or not.

I checked the channel fields API but through this API I can only update the structure of the field but what I'm trying to achieve is update the data available in it.

For example for a channel called Blog, I've added a custom field 'reference'. This custom field contains a URL. I need to update this URL based on an external API but sure how.

I'd be grateful for any help.

1

There are 1 answers

0
Brian Litzinger On

You can definitely do that, but the channel field API is actually old/deprecated. More recent versions of EE (5,6,7) use the new models. There are several ways to go about this, one of which is to create your own add-on with an Action URL you can call, and in the plugin/module code you can receive the API request and do what you want with it.

https://docs.expressionengine.com/latest/development/models/action.html https://docs.expressionengine.com/latest/development/modules.html

Or, you could take the easy path and use the DataGrab module, which is setup to do just this. Give it an API Url and it'll update entries. You can specific which fields to update. Full disclosure I own that add-on, just giving you options :) https://boldminded.com/add-ons/datagrab

You should check out the forums, or better yet the Slack, where people are pretty active. https://expressionengine.com/forums https://expressionengine.com/blog/join-us-in-slack#join-us-on-slack