Guide me to get All the pages of Confluence in a Space using the Rest API?

I am using Jira Webwork in Project Administration panel to display the list of confluence pages present for a project.

I wanted to fetch all the confluence page id with respect to Space key.

Is it possible to do this using java coding in webwork action?

Or else, please guide me how to do this using Confluence Rest API.