Mastering Producing Liferay Headless APIs

Generating No-Code APIs

Liferay Objects offers a streamlined approach to data accessibility, eliminating the complexities associated with traditional headless API development. By automatically generating headless APIs, Liferay empowers users to quickly define, expose, and manage data without coding. This no-code method simplifies integration processes, enabling rapid deployment and adaptation to evolving business needs.

Object APIs mirror your object definitions, with changes instantly synchronized. This empowers business users to create APIs via the visual Liferay Objects editor and quickly adapt data models.

By using Liferay Objects, you can rapidly generate CRUD endpoints, enabling comprehensive management of fields and relationships between Liferay Objects and external systems. This facilitates seamless integration and tailored front-end experiences without custom API development.

Understanding Generated Object APIs

Publishing an object automatically generates a standard set of API endpoints, accessible via the c/[pluralobjectlabel] pattern. Clarity aims to leverage these APIs to rapidly integrate their Know-Your-Customer (KYC) systems with their distributor applications. Clarity can leverage the object's GET, PUT, POST, PATCH and DELETE endpoints to track KYC details such as an applicant's credit status, risk scores, review notes, and verification flags. These headless API endpoints provide core data creation and management functionalities without customization or coding.

See Using Custom Object APIs for more information about default API endpoints.

Publishing an object automatically generates a standard set of API endpoints.

Beyond basic CRUD operations, Liferay also generates endpoints for these functionalities:

  • Managing Permissions: Leverage Liferay's role-based permissions with dedicated GET and PUT endpoints for fine-grained access control for objects and their entries.
  • Tagging and Categorization: Read, set, and update tags and categories for object entries via API.
  • Filtering and Sorting: Efficiently retrieve data subsets using filtering, sorting, and pagination. See Mastering Consuming Liferay Headless APIs for details.
  • Object Relationships: Query and manage related object entries with dedicated GET, PUT, and DELETE endpoints.
  • Manual Object Actions: Trigger manual object actions using dedicated PUT endpoints.

Exploring Object APIs

Object APIs are readily accessible via the Liferay API Explorer (/o/api). This interface displays schema information for each API, detailing its structure and data requirements. Reviewing the schema ensures accurate API calls by revealing available fields and parameters.

The Liferay API Explorer displays schema information for each API.

While you can query object entries using IDs or External Reference Codes (ERCs), ERC endpoints are best for clarity and consistency, especially in multi-system environments.

Conclusion

Liferay Objects simplifies API creation, making custom data models readily accessible. Automatic CRUD generation enables rapid development of robust integrations. Understanding Liferay object API endpoints empowers effective data management and scaling through headless APIs.

Next, you'll learn how to leverage API endpoints for object actions.

  • Understanding Generated Object APIs

  • Exploring Object APIs

  • Conclusion

Capabilities

Product

Education

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy