2

I've been tasked with reviewing Craft as a potential solution for the company I work for and one of the requirements is that we need to be able to provide data from a external API in the page creating/editing interface in the backend.

Is this possible and if so how?

1

Short answer: yes it is

Long answer: there are quite a few ways to achieve that. You can create a custom plugin with a custom element type to create a list just like the normal entries in craft filled with your data. You can then - during the saving process - update the data with your api to sync it with whatever you want.

If you are kind of lazy you could just create a normal section for your entries with all the required fields from your api and create a cronjob/task/function to download/fetch all entries with your api and hook into a onBeforeSaveEntry to validate the data and upload it to your api.

So all in all yes. It's relative easy and can be done in quite a few hours/days once you get used to Craft because the CMS does many things for you. It renders all lists/forms and manages the entire saving, sorting, filtering and searching processes for you. You just have to import the data (easy thing) and export the data. If you require some special sort validations you can include those rules too and Craft displays all errors

0

A real easy way is to use something like the FeedMe plugin, https://straightupcraft.com/craft-plugins/feed-me, against the api endpoint. Map it to your fields, give it a pending status so they are not live when imported. Then they can just open the entry and edit as they see fit. As mention above, Run it against a cron job for a hands off daily import

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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