Error when trying to Get Organizations Role's Users

@j.krabs I tried using it like in documentation (adding roles parameter to fields query string) and it gives me following error:
"message": "Query validation error: 'String 'roles' does not match pattern. Must be a comma separated list of the following values: user_id,email,picture,name' on property fields (Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields)."

@vladimir.bulatovic I can not reproduce your error-behaviour. I’m sorry. I just tested it out and it worked like described in the documentation for me.

Apart from that: unfortunately the endpoint is still missing a “sort”-feature, which would be good to have for working with larger data-sets. But this is another topic, so I will open another request…

1 Like

Still not working, can somebody from the Auth0 team explain what needs to be done to use this? I have the required scope in the token, the only thing that I added to the API request is fields=email,roles just like it is written in the documentation.

Thanks for posting an update @j.krabs!

Everything is working as expected for me. Can you please share the entire request (remove any sensitive data) so we can troubleshoot? Here is what is working for me:

curl -L 'https://{DOMAIN}.auth0.com/api/v2/organizations/{ORG_ID}/members?fields=roles%2Cemail' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {ACCESS_TOKEN}'

Here is my request

curl -L 'https://{DOMAIN}.auth0.com/api/v2/organizations/{ORG_ID}/members?fields=roles%2Cemail' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {ACCESS_TOKEN}'

And it gives me same error from above.

Can you please DM me the name of your tenant so I can investigate further? Thank you.

Thanks for sending that over. I moved this to a new thread so we aren’t pinging everyone in the original thread.

I can’t find anything in the tenant that would be causing this. Have you had the chance to try it on another tenant? Also, how are you getting the access token?

Thanks for checking on this. It started working this morning so everything looks good now. Thank you for your help!

1 Like

Thanks for following up. Please let me know if you see this behavior again.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.