Skip to the content
Documentation

Extension functionality

No ratings yet

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:

  1. Understanding the REST URI pattern
  2. Understanding REST API versioning
  3. Extending the REST API: the provider, the controller, the settings
  4. 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

Comments

Add a comment

Comments are read by a moderator before they appear.