{"action":"created","issue":{"url":"https://api.github.com/repos/WP-API/WP-API/issues/386","repository_url":"https://api.github.com/repos/WP-API/WP-API","labels_url":"https://api.github.com/repos/WP-API/WP-API/issues/386/labels{/name}","comments_url":"https://api.github.com/repos/WP-API/WP-API/issues/386/comments","events_url":"https://api.github.com/repos/WP-API/WP-API/issues/386/events","html_url":"https://github.com/WP-API/WP-API/issues/386","id":39031514,"number":386,"title":"Add `roles` param for `GET /wp/v2/users`","user":{"login":"kadamwhite","id":442115,"avatar_url":"https://avatars.githubusercontent.com/u/442115?v=3","gravatar_id":"","url":"https://api.github.com/users/kadamwhite","html_url":"https://github.com/kadamwhite","followers_url":"https://api.github.com/users/kadamwhite/followers","following_url":"https://api.github.com/users/kadamwhite/following{/other_user}","gists_url":"https://api.github.com/users/kadamwhite/gists{/gist_id}","starred_url":"https://api.github.com/users/kadamwhite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kadamwhite/subscriptions","organizations_url":"https://api.github.com/users/kadamwhite/orgs","repos_url":"https://api.github.com/users/kadamwhite/repos","events_url":"https://api.github.com/users/kadamwhite/events{/privacy}","received_events_url":"https://api.github.com/users/kadamwhite/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/WP-API/WP-API/labels/Enhancement","name":"Enhancement","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/WP-API/WP-API/milestones/10","html_url":"https://github.com/WP-API/WP-API/milestones/2.0","labels_url":"https://api.github.com/repos/WP-API/WP-API/milestones/10/labels","id":844496,"number":10,"title":"2.0","description":"","creator":{"login":"danielbachhuber","id":36432,"avatar_url":"https://avatars.githubusercontent.com/u/36432?v=3","gravatar_id":"","url":"https://api.github.com/users/danielbachhuber","html_url":"https://github.com/danielbachhuber","followers_url":"https://api.github.com/users/danielbachhuber/followers","following_url":"https://api.github.com/users/danielbachhuber/following{/other_user}","gists_url":"https://api.github.com/users/danielbachhuber/gists{/gist_id}","starred_url":"https://api.github.com/users/danielbachhuber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielbachhuber/subscriptions","organizations_url":"https://api.github.com/users/danielbachhuber/orgs","repos_url":"https://api.github.com/users/danielbachhuber/repos","events_url":"https://api.github.com/users/danielbachhuber/events{/privacy}","received_events_url":"https://api.github.com/users/danielbachhuber/received_events","type":"User","site_admin":false},"open_issues":33,"closed_issues":257,"state":"open","created_at":"2014-10-29T00:12:18Z","updated_at":"2016-03-14T23:37:46Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2014-07-29T20:30:33Z","updated_at":"2016-03-15T22:00:05Z","closed_at":null,"body":"I can get all users for a single role fairly easily, via the filter query parameter:\r\n```\r\n/wp-json/users?filter[role]=contributor\r\n```\r\nHowever, `filter[role]` doesn't seem to support the comma syntax that I can use in other commands:\r\n```\r\n// Doesn't work:\r\n/wp-json/users?filter[role]=contributor,author\r\n// I'd have expected it to work like this:\r\n/wp-json/posts?filter[author]=17,4,164\r\n\r\n```\r\nIs there any way through the API to query for users of multiple roles? At present I'm having to do this by chaining batches of queries, and even with promises that request syntax is nasty. I'd much prefer to get them as a single collection.\r\n\r\nRelated #924 "},"comment":{"url":"https://api.github.com/repos/WP-API/WP-API/issues/comments/197044379","html_url":"https://github.com/WP-API/WP-API/issues/386#issuecomment-197044379","issue_url":"https://api.github.com/repos/WP-API/WP-API/issues/386","id":197044379,"user":{"login":"danielbachhuber","id":36432,"avatar_url":"https://avatars.githubusercontent.com/u/36432?v=3","gravatar_id":"","url":"https://api.github.com/users/danielbachhuber","html_url":"https://github.com/danielbachhuber","followers_url":"https://api.github.com/users/danielbachhuber/followers","following_url":"https://api.github.com/users/danielbachhuber/following{/other_user}","gists_url":"https://api.github.com/users/danielbachhuber/gists{/gist_id}","starred_url":"https://api.github.com/users/danielbachhuber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielbachhuber/subscriptions","organizations_url":"https://api.github.com/users/danielbachhuber/orgs","repos_url":"https://api.github.com/users/danielbachhuber/repos","events_url":"https://api.github.com/users/danielbachhuber/events{/privacy}","received_events_url":"https://api.github.com/users/danielbachhuber/received_events","type":"User","site_admin":false},"created_at":"2016-03-15T22:00:05Z","updated_at":"2016-03-15T22:00:05Z","body":"> Should querying by roles only be doable by an authenticated request?\r\n\r\nCorrect. If the `roles` param is present on the request but the request is unauthorized, we should return an error.\r\n\r\n> Are there use cases you want to get a pool of users for a non admin user?\r\n\r\nI'm not sure I follow. Unauthorized users shouldn't be able to list users based on role, because they aren't permitted to see the role of the user.\r\n"}}