Hi,
I am trying to build automations on top of Retools List Users API. However, the following two questions came up in the process:
How does pagination work? I can see that next_token is returned in the response from the API, but what is the query parameter for using the next_token to get the next page?
How can I get the permissions of the users? Is it in the metadata of the user schema?
Pagination:
We currently send all results for all responses except for Resources. The query param is next_token, but we do have to include __RETOOL_ENCRYPTED___(<token>). Here is an example:
Permissions:
Although the response of a GET request to /users or /users/user_id doesn't include permissions, there is a way to extract this information.
Getting a list of User Groups will include their members:
If we wanted to get Permissions for one user, we could use JS to filter the result from groups, selecting the ones that include a user by id or email. Then, make a request to get the Permissions for that group or groups.
Pro tip: you could create a Retool app with Rest API resources that make these requests and have a dashboard that displays this data.