Let’s implement a comprehensive REST API in Concrete CMS 9.2.0. This API should cover
Pages
Users
Files
Sites
Express
and more…
This API should be viewable with Swagger UI and conform to REST API best practices.
Fortunately, most of this work has already been done! This repository documents a proposed REST API for 9.2.0:
It is a WORKING API (!). All REST endpoints within the API proposal package are complete (although they are not 100% tested and I’m sure there are bugs - that’s why we need help testing!)
Please let me know what you think regarding formats, naming, endpoints, scope names, etc… Your feedback is important.
Instructions for installing this demonstration package can be found within the package’s README. For a quick demonstration of the package and how to view the proposed REST API documentation, check out this video:
Hi! I tried to test this on 9.1.1 (local testing site), but on install shows this error: "Target class [OpenApi\Serializer] does not exist." Is the Serializer class missing from the package?
My mistake - I did not include the vendor/ directory for the package. I have updated the package and checked the vendor/ directory in, which should solve this problem. Alternatively, you can also just run composer install from the root of the package’s directory to install the dependencies (like @dbuonomo said)
this is awesome, can’t wait for it to be in the core… It was express and API that actually brought me to concrete in the 1st place. A powerful combo
2 observations:
in the git installation manual it states
For the redirect URL in this API integration, specify http://www.yoursiteurl.com/packages/concrete_api_proposal_2022/swagger/oauth2-redirect.html
which is not required/done automatically. It’s odd anyway as it just stated don’t create a integration.
my base-path of the side is in subfolder. the swagger however shoots against the base path
should be: http://mysite.com**/CMS**/index.php/ccm/api/proposed/…
actually used: http://mysite.com/index.php/ccm/api/proposed/…
(on my actual life environment this subfolder will be gone, but for my test server this kind of stops everything at the moment since swagger spits out just 404 not found)
Just wanted to let you know that I think some of these issues have been resolved, and the code has actually been merged into the core as of a semi-recent commit in the develop branch. I’m not 100% certain that it will fix issue two (but it’s worth testing) – but issue number 1 should be resolved. Each API integration actually has a checkbox that, if checked, will add a button to the Dashboard and enable a documentation redirect URL for that integration.
This looks great, do you have any dates for when it will be released into the core? I have a project just starting that needs to create pages & add data to express via an api, so this will work perfectly.