Extension functionality
An extension can add its own routes to the REST API: a provider registers a prefix below /api, its routes and their versions, and controllers answer them. Authentication, permissions, CORS, caching and the JSON output come from the kernel's REST framework.
The steps, with a complete example:
- Understanding the REST URI pattern
- Understanding REST API versioning
- Extending the REST API: the provider, the controller, the settings
- Conclusion
Examples in the code: the help API (kernel/classes/help/content/rest/, a small provider and controller) and ezprestapi (extension/ezprestapi/classes/, the content API with several versions).
Related pages
In this section
Contributors
- Geir Arne Waaler
- Graham Brookins Updated Maintainer
Comments
Add a comment