Skip to content

User Junofilter

Attempt to filter users

Request

post /users/junofilter?limit=10&page=1&properties=test&sort=ASC

Parameters

Parameter Type Path/Query Required Notes
limit integer query yes maximum number of objects that junofilter returns as a response
page integer query yes page number that filter returns
properties string query yes value that defines filter
sort string query yes ascending or descending sorting of filter results

Request body

Attributes               Type Required Notes
locked boolean no defines if user account is locked
deleted boolean no defines if user account is deleted
archived boolean no defines if user account is archived
substring string no search object by text
teamsFilter object no object contains operator and value, operator defines if filter works with "=" or "!=" and value is an integer that defines what is being filtered
entityType string no defines module from which junofilter is called
entityId integer no defines identifier of project/docs-space which should be used for filtering of users
userIds array no defines ids of users which are used (and in junofilter will be shown above all others)

curl --location 'https://devapi.juno.one/users/junofilter' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJkZXZlbG9wbWVudCIsImV4cCI6MTY4MjMzOTQwNn0.XWAuQmaKsv5fh60umfYO2gMwtXUjWLWsy6HbDt_fQXV6HPhgQhMkqmmzhWaCXsUP9h-dvKrQowLdqBqHHTYQAA' \
--header 'X-TenantID: development' \
--header 'Content-Type: application/json' \
--data '{
    "locked": null,
    "deleted": null,
    "archived": null,
    "substring": null,
    "teamsFilter": null,
    "entityType": null,
    "entityId": null,
    "usedIds": []
}'
{
"locked": false,
"deleted": false,
"archived": false,
"substring": "demouser@juno.one",
"teamsFilter": null,
"entityType": null,
"entityId": null,
"usedIds": [1,2]
}
import requests
import json

url = "https://devapi.juno.one/users/junofilter"

payload = json.dumps({
  "locked": None,
  "deleted": None,
  "archived": None,
  "substring": None,
  "teamsFilter": None,
  "entityType": None,
  "entityId": None,
  "usedIds": []
})
headers = {
  'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJkZXZlbG9wbWVudCIsImV4cCI6MTY4NDQ4MzYyNn0.cYdUo4oiHnkdAywSAb7EFus9PFg-2FYHZPj4gdMML-mKgUVZw9fewOo4QK6U3PqCzGWjFVksz8HULzyKMnV8AA',
  'X-TenantID': 'development',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
val client = OkHttpClient()
val mediaType = "application/json".toMediaType()
val body = "{\r\n    \"locked\": null,\r\n    \"deleted\": null,\r\n    \"archived\": null,\r\n    \"substring\": null,\r\n    \"teamsFilter\": null,\r\n    \"entityType\": null,\r\n    \"entityId\": null,\r\n    \"usedIds\": []\r\n}".toRequestBody(mediaType)
val request = Request.Builder()
  .url("https://devapi.juno.one/users/junofilter")
  .post(body)
  .addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJkZXZlbG9wbWVudCIsImV4cCI6MTY4NDQ4MzYyNn0.cYdUo4oiHnkdAywSAb7EFus9PFg-2FYHZPj4gdMML-mKgUVZw9fewOo4QK6U3PqCzGWjFVksz8HULzyKMnV8AA")
  .addHeader("X-TenantID", "development")
  .addHeader("Content-Type", "application/json")
  .build()
val response = client.newCall(request).execute()

Response

The successful response of user junofilter has the status 200 with the following response body:

{
  "data": [
    {
      "id": 1,
      "firstname": "test",
      "lastname": "test",
      "phone_number": null,
      "description": null,
      "email": "testUser@juno.one",
      "superadmin": false,
      "language": "en",
      "lastlogin": null,
      "locked": false,
      "lock_at": null,
      "lock_to": null,
      "deleted": false,
      "deleted_at": null,
      "created_at": "2023-03-02T15:16:36.445Z",
      "updated_at": "2023-03-02T15:16:36.445Z",
      "avatar": "1",
      "teams": {
        "id": 1,
        "name": "demo team",
        "deleted": false,
        "deleted_at": null,
        "created_at": "2021-08-04T10:20:11.000Z",
        "updated_at": "2021-08-04T10:20:11.000Z",
        "roles": [
          {
            "id": 1,
            "name": "demo role",
            "deleted": false,
            "deleted_at": null,
            "created_at": "2021-08-04T10:20:11.000Z",
            "updated_at": "2021-08-04T10:20:11.000Z",
            "perms": [
              {
                "id": 1,
                "module_id": 9,
                "module_name": "privilege.module.settings",
                "position": 1,
                "position_name": "privilege.module.settTeams",
                "column_id": 1,
                "disabled": false,
                "name": "view teams",
                "description": "privilege.viewTeams",
                "guard_name": "api",
                "created_at": "2023-01-16T14:37:21.000Z",
                "updated_at": "2023-01-16T14:37:21.000Z"
              }
            ]
          }
        ]
      }
    }
  ],
  "first": true,
  "last": true,
  "totalPages": 1,
  "totalElements": 1,
  "numberOfElements": 1,
  "limit": 10,
  "pageNumber": 1,
  "sort": [
    0
  ]
}

400 Bad Request

{
  "timestamp": "2022-02-16T17:11:34.422+00:00",
  "status": 400,
  "error": "Bad Request",
  "message": "The request is missing page parameter",
  "path": "/users/junofilter"
}

404 Not found

{
  "timestamp": "2022-02-16T17:11:34.422+00:00",
  "status": 404,
  "error": "Not Found",
  "message": "User with id 30 was not found.",
  "path": "/users/junofilter"
}

500 Unknown error

{
  "timestamp": "2022-02-16T17:11:34.422+00:00",
  "status": 500,
  "error": "Unknown",
  "message": "There was a problem with your request. Please contact your administrator.",
}