Skip to content

Can not exec 'User List' query API #8916

@timiil

Description

@timiil

Description:

i am trying to query users with some simple condition, just like 'all active users'.

when i try to #1:

curl -H "X-Auth-Token: tz7L_ajNPk7KMbsdzmLP0prlGn_HNJ874pHJP7JCqIb" \
     -H "X-User-Id: oPn8LFLNaaZ3SokQP" \
     http://localhost:3380/api/v1/users.list

that is ok. no error, just return the full users list.

#2 shot:

curl -H "X-Auth-Token: tz7L_ajNPk7KMbsdzmLP0prlGn_HNJ874pHJP7JCqIb" \
>      -H "X-User-Id: oPn8LFLNaaZ3SokQP" \
>      http://localhost:3380/api/v1/users.list?query={active:true}
{
  "success": false,
  "error": "Invalid query parameter provided: \"active:true\" [error-invalid-query]",
  "errorType": "error-invalid-query"

#3 shot:

curl -H "X-Auth-Token: tz7L_ajNPk7KMbsdzmLP0prlGn_HNJ874pHJP7JCqIb" \
>      -H "X-User-Id: oPn8LFLNaaZ3SokQP" \
>      http://localhost:3380/api/v1/users.list?query='{active:true}'
{
  "success": false,
  "error": "Invalid query parameter provided: \"active:true\" [error-invalid-query]",
  "errorType": "error-invalid-query"

please let me know what is the correct manner about the query string, thanks very much!

Server Setup Information:

  • Version of Rocket.Chat Server: 0.60.0-develop
  • Operating System: debian
  • Deployment Method(snap/docker/tar/etc): docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • Node Version: 8.8.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions