Get set of resources info from Keycloak server via Keycloak rest endpoints


I need to retrieve more than 25 resources from the Keycloak server. I can use the following endpoint to get one resource:

http://{host}:{port}/auth/realms/{realm}/authz/protection/resource_set/{resource_id}

However, calling this endpoint more than 25 times is not feasible. Is there any other way to get a set of resources using a single endpoint?

Yes, you can use the following endpoint to retrieve multiple resources at once:

http://{host}:{port}/auth/realms/{realm}/authz/protection/resource_set/?first={first}&max={max}

Replace {first} with the index of the first resource you want to retrieve (starting from 0) and {max} with the maximum number of resources you want to retrieve. For example, if you want to retrieve the first 50 resources:

http://{host}:{port}/auth/realms/{realm}/authz/protection/resource_set/?first=0&max=50