List users and information via API

List users and information via API




List users and information via API



Introduction

Welcome, this is a tutorial to list users and their information via API.


Listing

Gets all users in the system and their information, the result is limited only to what the receiver has access to view. It supports the Offset, Count, and Sort Query Parameters along with the query parameters and fields.

Arguments:

URL
Require Authentication
Method HTTP

/api/v1/users.list

yes
POST


Query parameters:

Arguments
Examples
Required
Description
fields

{ name: 1, emails: 0 }


Optional

Field includes hash (value to include, to exclude). 1 0

query

{ active: true, type: { $in: ['user', 'bot'] } }

Optional

Query Filter Hash.


Example call from other users:


  1. curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
         -H "X-User-Id: aobEdbYhXfu5hkeqG" \

Example recipient regular user result :
  1. {
      "users": [
        {
          "_id": "nSYqWzZ4GsKTX4dyK",
          "type": "user",
          "status": "offline",
          "active": true,
          "name": "Example User",
          "utcOffset": 0,
          "username": "example"
        },
        {
          ...
        }
      ],
      "count": 10,
      "offset": 0,
      "total": 10,
      "success": true
    }

Example of administrative result:



  1. {
  2.   "users": [
  3.     {
  4.       "_id": "nSYqWzZ4GsKTX4dyK",
  5.       "createdAt": "2016-12-07T15:47:46.861Z",
  6.       "services": {
  7.         "password": {
  8.           "bcrypt": ...
  9.         },
  10.         "email": {
  11.           "verificationTokens": [
  12.             {
  13.               "token": "...",
  14.               "address": " example@example.com ",
  15.               "when": "2016-12-07T15:47:46.930Z"
  16.             }
  17.           ]
  18.         },
  19.         "resume": {
  20.           "loginTokens": [
  21.             {
  22.               "when": "2016-12-07T15:47:47.334Z",
  23.               "hashedToken": "..."
  24.             }
  25.           ]
  26.         }
  27.       },
  28.       "emails": [
  29.         {
  30.           "address": " example@example.com ",
  31.           "verified": true
  32.         }
  33.       ],
  34.       "type": "user",
  35.       "status": "offline",
  36.       "active": true,
  37.       "roles": [
  38.         "user"
  39.       ],
  40.       "name": "Example User",
  41.       "lastLogin": "2016-12-08T00:22:15.167Z",
  42.       "statusConnection": "offline",
  43.       "utcOffset": 0,
  44.       "username": "example"
  45.     },
  46.     {
  47.       ...
  48.     }
  49.   ],
  50.   "count": 3,
  51.   "offset": 2,
  52.   "total": 10,
  53.   "success": true
  54. }


In case of doubts or suggestions, please contact our support via e-mail: suportebr@myhive.global





    • Related Articles

    • Disable users via API.

      Disable users via API. Introduction Welcome, this is a tutorial to disable user via API. Note: Disable inactive users. Permission required:    edit-other-user-active-status. Parameters URL Require Authentication Method HTTP ...
    • Paging via API

      Paging via API. Introduction Welcome, this is a tutorial to help understand how to count, offset, sort via API. As of version, some of the endpoints support query parameters, and . However, the defaults are different by server due to configuration ...
    • Query and Fields via API.

      Query and Fields via API. Introduction Welcome, this is a tutorial to help understand the query and fields via API. Query and Fields As of version , some of the terminals support the query parameters and . These two fields are special because they ...
    • Set status via API

      Set status via API. Introduction Welcome, this is a tutorial to help set status via API. Defines a user status when status message and status are provided. Arguments: URL Require Authentication Method HTTP /api/v1/users.setAvatar yes POST  Payloads ...
    • Creating user via API.

      Creating user via API. Introduction Welcome, this is a tutorial to login via API Parameters URL Require Authentication Method HTTP /api/v1/users.create yes POST Variables Note: To save customFields, you must first define customFields in the admin ...