0

Has the J! project got an official REST API that can be used to manage a running Joomla site? At this stage it looks like we will need to manage at least: articles, categories, tags and perhaps even a menu.

I see there is mention of a web services layer and was wondering if that had been done/implemented?

Has anyone got any solutions or more information? Ultimately I have a C# application that needs to make changes to a Joomla website.

0

At this time, there is no official implementation.

There is working group: Web Services Working Group

And, there is also a project ready to be tested and planned to be merged in a future Joomla version: joomla-projects/webservices

As far as I know, it is mostly finished, but it is not tested for PHP 5.3. So, it is waiting until it can receive the last push.

In my case, when I need a REST API, I use to implement it for each use case with FoF framework help.

1

I had been waiting years for proper REST API support in Joomla, but eventually I ended up rolling my own solution and turned it into a commercial product. The following response is quoted & updated from an earlier response to a similar question:

https://stackoverflow.com/a/32706378/5361267

I ran into the same issue as well which is why I ended up developing a RESTful API for Joomla 3.6.x, powered by the Slim PHP micro-framework. Please note that this is a commercial Joomla package.

The package includes the following:

  • Services Control Panel component
  • Joomla "services" add-on library which includes a version of Slim v2.6.2 (along with several other libraries) obtain via composer and normally found in the vendor folder. More on this later...
  • Services Joomla Plugin
  • Services REST Plugin
  • Services Slim Configuration Plugin
  • Slim JSON API View plugin
  • Slim JSON API Middleware plugin

You might ask, "What is the point of all these plugins?"

The answer is that it allows for compartmentalization of functionality of the core components and opens the door for an easily extensible services routes architecture. Note that new plugins could easily be added with Joomla ACL restricting access to those new routes, for example.

The Services Control Panel allows for creation of tokens on a per-user basis (or even multiple tokens per Joomla user). It also allows the end user to configure the Slim micro-framework parameters and even include a threshold for the API rate-limiting functionality (currently based on requests-per-minute). Actually, that part is totally awesome as it provides live feedback on the state of the API rate threshold within the response header.

The cAPI Core package ("cAPI", short for "Constant API" because everything needs a product name...) is just that - a core package. There is a host of add-ons currently in development, the first one being a secure LDAP JSON API (which connects to Microsoft Active Directory), with lots more cool add-ons to come.

The whole point of all this is to say that, basically, your request has been answered and now a commercially supported solution has finally arrived. Plus, instead of reinventing the wheel, I based the extension on a popular, existing micro-framework (Slim), making it easier for developers to work with or develop on the core, pluggable, framework.

So, you get the best of Joomla (robust ACL, advanced plugin architecture, wealth of extensions) and Sim (proven, standards-compliant, mature RESTful PHP micro-framework), all in one easy to install package.

Exposing a website via an easily queryable API should not be taken lightly. I would hope anyone choosing to do this would implement 100% HTTPS access and security-harden their server(s).

You can find more information here: http://getcapi.org

Hope this gets you going in the right direction.

One more thing:

I read over your question again and read that part about your need to access users and content. These were actually the first service endpoints I worked on:

/api/v1/user/ - Can be used to log a user in and out and returns the activated Joomla session in the response - This also provides for multimodal authentication (both via token in header or username & password in URL string). Basically, it works with your needs. - You force a user logout like this: /api/v1/user/logout/username/joomlasessionid

Basically, this is tailor-made for driving remote services or, say iOS or Android apps.

(GET,POST,PUT,DELETE) /api/v1/content/...

- Provides ability to create, retrieve, update and delete content

(GET,POST,PUT,DELETE) /api/v1/category/...

- Provides ability to create, retrieve, update and delete categories

Also, /api/v1/user/login/(username)/(password)

/api/v1/user/logout/(username)/(joomlasessionid)

/api/v1/user/profile

/api/slim/routes

and more...

More information on available methods can be found here:

http://learn.getcapi.org/api-methods

It should go without saying that all cAPI Core package improves are included in the annual subscription fee. Add-ons are (will be) billed and supported separately.

Additional Notes

As of cAPI v1.2.1 new methods have been added to allow CRUD for Joomla user and group management. In addition, I am working on a sandbox cluster at http://getcapi.io to allow potential customers to fully test out the APIs capabilities before subscribing.

As of cAPI v1.2.5 new methods have been added to allow CRUD actions on API tokens. The API has also been updated with doc-blocks which can auto-generate a Swagger.json. cAPI includes both a back-end and front-end view for accessing the complete API docs generated by Swagger UI.

Finally, https://getcapi.io along with demo1.getcapi.io and demo2.getcapi.io are now live and allow visitors to test the API docs. Soon, they will be configured to auto-reset so that accounts can be distributed to customers so they may fully test the API on their own.

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.