Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to search for a user with the reporting API #7974

Open
mrjoops opened this issue May 22, 2015 · 5 comments
Open

No way to search for a user with the reporting API #7974

mrjoops opened this issue May 22, 2015 · 5 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. c: Usability For issues that let users achieve a defined goal more effectively or efficiently.

Comments

@mrjoops
Copy link

mrjoops commented May 22, 2015

I try to search my huge user base (40000+ entries) using the reporting API with the following parameters:

  • filter_column: login
  • filter_limit: 20
  • filter_pattern: ^publ
  • module: API
  • method: UsersManager.getUsers
  • token_auth: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

but I always get all my users as a result.

The response indeed contains the login column. Actually, it contains these columns:

  • alias
  • date_registered
  • email
  • login
  • password
  • superuser_access
  • token_auth

I tried other columns and patterns without success, filter_column and filter_pattern seem to have no effect.
By the way, filter_limit works as expected.

As a matter of fact, there is no way to search for a user. I really miss a method mirroring SitesManager.getPatternMatchSites for users.

@tsteur
Copy link
Member

tsteur commented May 24, 2015

That's a bug indeed. Those filters to currently not work for API's that return an array. filter_column and filter_pattern should work with the latest Piwik version though I think. Are you using the latest version (Piwik 2.13.1)?

@mrjoops
Copy link
Author

mrjoops commented May 25, 2015

I use Piwik 2.13.1.

@tsteur
Copy link
Member

tsteur commented May 25, 2015

I just had a look. It works if you use filter_column[]=^publ. This is a bug as I expected our internal logic here https://github.com/piwik/piwik/blob/2.14.0-b1/core/API/ResponseBuilder.php#L193 would actually convert filter_column=^publ to an array of ['^publ'].

If you need that feature now I recommend to use this workaround until it is fixed.

@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label May 25, 2015
@tsteur
Copy link
Member

tsteur commented May 25, 2015

@mattab I'm not sure re milestone.

It would be nice to make all those filter parameters work on all numeric indexed array returns for Piwik 3.0 but it's most likely not realistic.

@mattab
Copy link
Member

mattab commented May 25, 2015

@tsteur I think 3.0.0 is already over-committed so we can't do it for this version I'm afraid. But +1 for working on this in 3.x

@mattab mattab added this to the Mid term milestone May 25, 2015
@mattab mattab added the c: Usability For issues that let users achieve a defined goal more effectively or efficiently. label May 25, 2015
@mattab mattab modified the milestones: Long term, Mid term Dec 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. c: Usability For issues that let users achieve a defined goal more effectively or efficiently.
Projects
None yet
Development

No branches or pull requests

3 participants