GET rbac/roles

(Difference between revisions)
Jump to: navigation, search
(Created page with "== Description == Searches for Roles. == Resource URL == GET https://api.socialidnow.com/v1/rbac/roles == Parameters == === URL Parameters === {| ! align="left" width...")
 
(Response Body)
Line 66: Line 66:
 
|-
 
|-
 
! align="left" width="200px" | results
 
! align="left" width="200px" | results
| array with role details. See response from [[GET roles/:role_id]]
+
| array with role details. See response from [[GET rbac/roles/:role_id]]
 
|}
 
|}
  

Revision as of 00:28, 18 November 2022

Contents

Description

Searches for Roles.

Resource URL

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

Parameters

URL Parameters

name optional role name.
login_app_id optional application identifier.
ids optional comma separated list of role ids. Example: ids=1,2,3.
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.
internal_server_error (500) An unknown error happened.

Response Body

A successful search returns the following fields:

total total amount of roles found.
offset amount of discarded roles (page start).
count amount of roles returned in this page.
results array with role details. See response from GET rbac/roles/:role_id

Examples

Without search parameters

Request

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

Response

Response Headers
HTTP/1.1 200 Ok
Status: 200
Response Body
{
  "total": 50,
  "offset": 0,
  "count": 8,
  "results": [
    {
      "id": 1,
      "name": "Role A",
      "login_app_id": 100,
      "description": "My Role A description",
      "created_at": "2022-11-17T21:30:00Z",
      "updated_at": "2022-11-17T21:30:00Z"
    },
    {
      "id": 2,
      "name": "Role B",
      "login_app_id": 100,
      "description": "My Role B description",
      "created_at": "2022-11-17T21:31:00Z",
      "updated_at": "2022-11-17T21:31:00Z"
    },
    {
      "id": 3,
      "name": "Role C",
      "login_app_id": 100,
      "description": "My Role C description",
      "created_at": "2022-11-17T21:32:00Z",
      "updated_at": "2022-11-17T21:32:00Z"
    },
    {
      "id": 4,
      "name": "Role D",
      "login_app_id": 200,
      "description": null,
      "created_at": "2022-11-17T21:33:00Z",
      "updated_at": "2022-11-17T21:33:00Z"
    },
    {
      "id": 5,
      "name": "Role E",
      "login_app_id": 200,
      "description": null,
      "created_at": "2022-11-17T21:34:00Z",
      "updated_at": "2022-11-17T21:34:00Z"
    },
    {
      "id": 6,
      "name": "Role F",
      "login_app_id": 200,
      "description": null,
      "created_at": "2022-11-17T21:35:00Z",
      "updated_at": "2022-11-17T21:35:00Z"
    },
    {
      "id": 7,
      "name": "Role G",
      "login_app_id": 200,
      "description": null,
      "created_at": "2022-11-17T21:36:00Z",
      "updated_at": "2022-11-17T21:36:00Z"
    },
    {
      "id": 8,
      "name": "Role H",
      "login_app_id": 200,
      "description": null,
      "created_at": "2022-11-17T21:37:00Z",
      "updated_at": "2022-11-17T21:37:00Z"
    }
  ]
}

With search parameters

Request

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

Response

Response Headers
HTTP/1.1 200 Ok
Status: 200
Response Body
{
  "total": 3,
  "offset": 2,
  "count": 1,
  "results": [
    {
      "id": 3,
      "name": "Role C",
      "login_app_id": 100,
      "description": "My Role C description",
      "created_at": "2022-11-17T21:32:00Z",
      "updated_at": "2022-11-17T21:32:00Z"
    }
  ]
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox