How can I view the list of Liferay JSON Web Services?
To overview and verify which service methods are registered and available, user can use following URL to list them all in browser (notice the ‘jsonws’ in the URL, it is relevant for all JSON Web Services calls – more on invocation later:
http://localhost:8080/api/jsonws
The result is a list of all registered and exposed service methods. For each method user can see more details, by clicking the method name. On method details page, user can even invoke the method for testing purposes.
To list registered services on portlet, don’t forget to use portlet contenxt path:
http://localhost:8080/<portlet>/api/jsonws
For more information you can see the follow resources:
- Yet Another Liferay JSON Service Example
- JSON Web Services
- Liferay APIs
The follow figures show a set of the examples.
The follow command (curl) for execute a call for the GetUserById service.
curl http://localhost:8080/api/secure/jsonws/user/get-user-by-id -u test@liferay.com:test -d p_auth=Z2wAxRKd -d userId=11801 | python -m json.tool