Concrete API-Centric Web Application between multiple concrete sites(client) and concrete host(server)

Permalink
I am trying to create an API-Centric Web Application between multiple concrete sites(clients) and a main concrete site(server), however I required the basic concrete framework to leverage the core structure from a independent file e.g. api.php. I have tried including the concrete/dispatcher.php but this has not worked. A similar example would be wordpress where the include of 'wp-load.php' loads the core required files.

What do I need to include into the stand-alone page to leverage the concrete framework?

 
RadiantWeb replied on at Permalink Reply
RadiantWeb
Hi, I've done this several ways, here are a few that I find reasonable and for the most part not all that hard:

1 - use the radiantweb_api installer: https://github.com/goradiantweb/radiantweb_api...

pretty straight forward. demonstrates how to use single pages & models for API passing. Has a very flexible passthrough method and 32char API key register by user.

2 - use a combination of tools and model files.

create a request tools file. I usually place them in the packages tools folder so that the call url ishttps://sitename.com/tools/packages/package_name/API/request...

the tools then calls on an api model and returns json.

The later is fine for $_GET but you may find the radiantweb_api helpful for protected requests like $_PUT/$_POST

ChadStrat
mkly replied on at Permalink Reply
mkly
Just before you include concrete/dispatcher.php you should set
define('C5_ENVIRONMENT_ONLY', true);


There is a project that builds a Slim Framework middleware that might help you by looking at the code.

https://github.com/olsgreen/slim-concrete5/tree/master/Concrete5/Mid...