Core
API v2.x
2

mGetRoles #

Gets multiple security roles.


Query Syntax #

HTTP #

URL: http://kuzzle:7512/roles/_mGet
Method: POST
Body:
{
  "ids": ["role1", "role2"]
}

Other protocols #

{
  "controller": "security",
  "action": "mGetRoles",
  "body": {
    "ids": ["role1", "role2"]
  }
}

Body properties #

  • ids: an array of role identifiers to get

Response #

Returns a hits array of objects. Each object is a role description, with the following properties:

  • _id: role unique identifier
  • _source: role description
{
  "status": 200,
  "action": "mGetRoles",
  "controller": "security",
  "error": null,
  "requestId": "<unique request identifier>",
  "result": {
    "hits": [
      {
        "_id": "role1",
        "_source": {
          "controllers": {
            "*": {
              "actions": true
            }
          }
        }
      },
      {
        "_id": "role2",
        "_source": {
          "controllers": {
            "document": {
              "actions": {
                "get": true,
                "search": true
              }
            }
          }
        }
      }
    ]
  }
}