Before you start: read API token, curl, jq.
- Request page one with
limit, e.g.GET /identities?kind=user&limit=100. - While
has_moreistrue, passcursorset tonext_cursorunchanged. - Stop when
has_moreisfalse.
bash
cursor=""
url="$PRINCIPAL_URL/api/v2/identities?kind=user&limit=100"
while true; do
page=$(curl -s -H "Authorization: Bearer $PRINCIPAL_TOKEN" \
"${url}${cursor:+&cursor=$cursor}")
echo "$page" | jq -r '.items[].display_name'
[ "$(echo "$page" | jq -r '.has_more')" = "true" ] || break
cursor=$(echo "$page" | jq -r '.next_cursor')
done