GET rbac/roles/:role id/users

From Social ID Developers
Jump to: navigation, search

Contents

Description

Searches for Users with a Role.

Resource URL

  GET https://api.socialidnow.com/v1/rbac/roles/:role_id/users

Parameters

URL Parameters

role_id required role identifier.
login_user_id optional user identifier.
page optional page number (each page contains page_size results). Default: 1.
page_size optional maximum amount of results to be returned. Default: 8.

Authentication

This API requires Account authentication. See Authentication.

Response

Response Status

ok (200) The request was successful.
unauthorized (401) The authentication is wrong. See Authentication.
forbidden (403) The account does not have access to this role.
internal_server_error (500) An unknown error happened.

Response Body

A successful search returns the following fields:

total total amount of role users found.
offset amount of discarded role users (page start).
count amount of role users returned in this page.
results array with role users details:
created_at date when the role was added to the user.
source_type type of the source that added the role to the user. Possible values: "custom" or "group".
source_id source identifier. When source type is "custom", this value is a plain string. When source type is "group", this value is the group identifier.
login_user_id user identifier.
login_user user details. See response from GET login/users/:user_id

Examples

Without search parameters

Request

curl -iX GET 'https://api.socialidnow.com/v1/rbac/roles/1/users' \
  --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf

Response

Response Headers
HTTP/1.1 200 Ok
Status: 200
Response Body
{
  "total": 30,
  "offset": 0,
  "count": 8,
  "results": [
    {
      "created_at": "2022-11-17T22:30:00Z",
      "source_type": "custom",
      "source_id": "admin",
      "login_user_id": 10,
      "login_user": {
        "id": 10,
        "token": "0dffb953f89c5fd2a244232f9066534ae28be92f138edf29618bdf96c0397629",
        "signed_up_at": "2022-11-17T20:00:00Z",
        "signed_in_at": "2022-11-17T20:00:00Z",
        "username": "user 1",
        "email_address": "user1@domain.com",
        "active": true,
        "confirmed": true,
        "locked": false
      }
    },
    {
      "created_at": "2022-11-17T22:31:00Z",
      "source_type": "custom",
      "source_id": "api",
      "login_user_id": 20,
      "login_user": {
        "id": 20,
        "token": "cc1f8d2b98f6e2f6f41191a791cc81113e135b3377ce22e9aeb601683f48161f",
        "signed_up_at": "2022-11-17T20:01:00Z",
        "signed_in_at": "2022-11-17T20:01:00Z",
        "username": "user 2",
        "email_address": "user2@domain.com",
        "active": true,
        "confirmed": true,
        "locked": false
      }
    },
    {
      "created_at": "2022-11-17T22:32:00Z",
      "source_type": "group",
      "source_id": 1,
      "login_user_id": 30,
      "login_user": {
        "id": 30,
        "token": "4ecac1a56c8812803c13a4bc93b31b18bec416d0bb0339d4664515f5478050bf",
        "signed_up_at": "2022-11-17T20:02:00Z",
        "signed_in_at": "2022-11-17T20:02:00Z",
        "username": "user 3",
        "email_address": "user3@domain.com",
        "active": true,
        "confirmed": true,
        "locked": false
      }
    },
    {
      "created_at": "2022-11-17T22:33:00Z",
      "source_type": "group",
      "source_id": 1,
      "login_user_id": 40,
      "login_user": {
        "id": 40,
        "token": "60de1156c378d021c8ca643dcdf5ac6d70b4fb211dcebe74f2317c67949996bd",
        "signed_up_at": "2022-11-17T20:03:00Z",
        "signed_in_at": "2022-11-17T20:03:00Z",
        "username": "user 4",
        "email_address": "user4@domain.com",
        "active": true,
        "confirmed": true,
        "locked": false
      }
    },
    {
      "created_at": "2022-11-17T22:34:00Z",
      "source_type": "group",
      "source_id": 2,
      "login_user_id": 50,
      "login_user": {
        "id": 50,
        "token": "c85fad00c6bd977251e891f738bda4bd6ef2aa0ac76ed7e213b619feff0ed838",
        "signed_up_at": "2022-11-17T20:04:00Z",
        "signed_in_at": "2022-11-17T20:04:00Z",
        "username": "user 5",
        "email_address": "user5@domain.com",
        "active": true,
        "confirmed": true,
        "locked": false
      }
    },
    {
      "created_at": "2022-11-17T22:35:00Z",
      "source_type": "group",
      "source_id": 2,
      "login_user_id": 60,
      "login_user": {
        "id": 60,
        "token": "55236cf05ec7225a20797064bb97392f6686c0aa1321efc29df28165faeadc27",
        "signed_up_at": "2022-11-17T20:05:00Z",
        "signed_in_at": "2022-11-17T20:05:00Z",
        "username": "user 6",
        "email_address": "user6@domain.com",
        "active": true,
        "confirmed": true,
        "locked": false
      }
    },
    {
      "created_at": "2022-11-17T22:36:00Z",
      "source_type": "group",
      "source_id": 3,
      "login_user_id": 70,
      "login_user": {
        "id": 70,
        "token": "35b5aaa1b1c37d4c7c99e86f2684d208d3d615b15d0e522758170773ef370f39",
        "signed_up_at": "2022-11-17T20:06:00Z",
        "signed_in_at": "2022-11-17T20:06:00Z",
        "username": "user 7",
        "email_address": "user7@domain.com",
        "active": true,
        "confirmed": true,
        "locked": false
      }
    },
    {
      "created_at": "2022-11-17T22:37:00Z",
      "source_type": "group",
      "source_id": 4,
      "login_user_id": 80,
      "login_user": {
        "id": 80,
        "token": "c8d885bad752c819e9f800cff66f493cf8d6b5629b378060d6016d7c9d1e3100",
        "signed_up_at": "2022-11-17T20:07:00Z",
        "signed_in_at": "2022-11-17T20:07:00Z",
        "username": "user 8",
        "email_address": "user8@domain.com",
        "active": true,
        "confirmed": true,
        "locked": false
      }
    }
  ]
}

With search parameters

Request

curl -iX GET 'https://api.socialidnow.com/v1/rbac/roles/1/users?page_size=3&page=2' \
  --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf

Response

Response Headers
HTTP/1.1 200 Ok
Status: 200
Response Body
{
  "total": 30,
  "offset": 3,
  "count": 3,
  "results": [
    {
      "created_at": "2022-11-17T22:33:00Z",
      "source_type": "group",
      "source_id": 1,
      "login_user_id": 40,
      "login_user": {
        "id": 40,
        "token": "60de1156c378d021c8ca643dcdf5ac6d70b4fb211dcebe74f2317c67949996bd",
        "signed_up_at": "2022-11-17T20:03:00Z",
        "signed_in_at": "2022-11-17T20:03:00Z",
        "username": "user 4",
        "email_address": "user4@domain.com",
        "active": true,
        "confirmed": true,
        "locked": false
      }
    },
    {
      "created_at": "2022-11-17T22:34:00Z",
      "source_type": "group",
      "source_id": 2,
      "login_user_id": 50,
      "login_user": {
        "id": 50,
        "token": "c85fad00c6bd977251e891f738bda4bd6ef2aa0ac76ed7e213b619feff0ed838",
        "signed_up_at": "2022-11-17T20:04:00Z",
        "signed_in_at": "2022-11-17T20:04:00Z",
        "username": "user 5",
        "email_address": "user5@domain.com",
        "active": true,
        "confirmed": true,
        "locked": false
      }
    },
    {
      "created_at": "2022-11-17T22:35:00Z",
      "source_type": "group",
      "source_id": 2,
      "login_user_id": 60,
      "login_user": {
        "id": 60,
        "token": "55236cf05ec7225a20797064bb97392f6686c0aa1321efc29df28165faeadc27",
        "signed_up_at": "2022-11-17T20:05:00Z",
        "signed_in_at": "2022-11-17T20:05:00Z",
        "username": "user 6",
        "email_address": "user6@domain.com",
        "active": true,
        "confirmed": true,
        "locked": false
      }
    }
  ]
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox