We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Load ExpresionEngine in External API

How Do I?

EXODev's avatar
EXODev
4 posts
about 9 years ago
EXODev's avatar EXODev

Hi all,

I need to develop several APIs for our web application. Mostly, these are data synchronization tasks. These APIs will run out of a an API folder on root as such:

/apis/xyz_api/synchronize.php

Once I have the external data loaded into arrays, I would like to use EE2 to populate/update the channels. It will be much more concise if I can use the EE models for this, rather than MySQL queries.

So, how do I instantiate EE in this case?

Than you for your help.

       
Derek Jones's avatar
Derek Jones
7,561 posts
about 9 years ago
Derek Jones's avatar Derek Jones

ExpressionEngine isn’t meant to be executed externally apart from its own controllers and views. So the best way to handle data coming from an external source is probably to make your own endpoint in a module using an action request. https://docs.expressionengine.com/latest/development/modules.html#install

Your module would validate and sanitize the input, and then have the entire app at its disposal to do whatever you need to do with this external data.

       
EXODev's avatar
EXODev
4 posts
8 years ago
EXODev's avatar EXODev

Thanks Derek.

I am now developing an API Framework based on this approach:

https://medium.com/expressionengine-cms/building-an-api-for-your-add-ons-with-expressionengine-and-the-a-team-85c1c9bc9e2c#.9ztwkch2e

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.