0

This has been asked by @jrothafer before, but no answer was provided:

Load framework outside of folder structure

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.

1

Have you considered just keeping your API within EE's folder structure and building an add-on to trigger your API functions? Depending on how extensive your API will be, you could either create module action URIs to accept POST data, or for more readable API URIs you could piggyback on the sessions_start extension hook like the Open API does. Here's a quick rundown: https://medium.com/expressionengine-cms/building-an-api-for-your-add-ons-with-expressionengine-and-the-a-team-85c1c9bc9e2c#.9ztwkch2e

Here's Open API: https://github.com/putyourlightson/open-api

And for more simple read operations you can use the JSON add-on https://github.com/rsanchez/json

| improve this answer | |
  • Thanks, James. I guess that's what I am going with then. Have already started expanding the solution to handle the various third party integrations. – EXODev Jun 16 '16 at 7:29

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.