This website uses cookies to ensure you get the best experience. Learn More.
The API Explorer, all you need to start using the Liferay Headless APIs
The API Explorer is an integrated application inside Liferay Portal offering all you need to familiarize and start using the Liferay Headless APIs.
To access the API Explorer:
There you will find the updated documentation of all the APIs that are available on your Liferay instance for REST and GraphQL.
The REST view is the default view and the one that you will see when you enter the application.
If you have already used SwaggerHub to search API docs, you will probably find the interface so familiar, as we are using the same technology under the hood.
In the upper right corner of the screen you have a dropdrdown menu to select between every API group/category available in the portal. When you select one of them, the page will list all available endpoints, methods for each endpoint and schemas.
But you don’t need to stop at the docs, you can make some test requests inside the application:
This is a great way to explore and find the useful APIs for your application, test the requests and then implement them in your code.
If you are more into using GraphQL than REST APIs, you can also explore all the available queries and mutations of your portal instance clicking in the GraphQL link in the top right corner of the screen to change to the GraphQL view.
The GraphQL view uses GraphiQL so it should be familiar to those who have used that tool before. For those who have not, it presents three columns:
The Query Editor to write your GraphQL queries, with autocomplete capabilities and validation.
The Response Window to check the resulting response.
The Doc Explorer to explore the documentation of all available queries, mutations and types.
To make a test request:
Start writing your request in the Query Editor. Let the autocompletion and validation help you to find what you are looking for.
You can use the Doc Explorer to check the queries and mutations available, required parameters and type definitions.
Click the ▶ button to execute the query.
See the received response with the actual data that exists in your portal instance.
Whether you use REST or GraphQL to access the features exposed through the Headless API, adding the API Explorer tool to your flow will allow you to increase your development productivity with an easy way to find and understand the API, and try your requests to get the information you need before you implement them in your code.
And all of it right away within your Liferay installation, without the need of external tools!
If you have a Liferay bundle installed, just point your browser to /o/api and start playing around with the APIs