get_tag_by_key

TbacApi.get_tag_by_key(key, role_id, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Get all users in the system by tag key

Currently only supports key=”user”. Returns a list of all users in the system with basic profile fields (UserId, Name, EmailId, IsActive). The response wraps the user list in a structure with hardcoded metadata fields (TagValue, CreationTime, etc. are all “N/A”). Any key value other than “user” returns error GE-1010.

Parameters:
  • key (str) – The tag key to query. Currently only “user” is supported. (required)

  • role_id (str) – The role ID from the user’s session. (required)

  • _request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • _request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.

  • _content_type (str, Optional) – force content-type for the request.

  • _headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.

  • _host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.

Return type:

GetTagByKeyResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: GET /tags/{key}

Success (HTTP 200)

List of all users wrapped in a tag-like structure.

Request / response example

{
  "TagKey": "user",
  "TagValue": "N/A",
  "CreationTime": "N/A",
  "CreatedBy": "N/A",
  "LastModifiedTime": "N/A",
  "Message": "string",
  "UserAttached": [
    {
      "UserId": "test.user",
      "Name": "Test User",
      "EmailId": "testuser@example.com",
      "IsActive": "yes"
    }
  ]
}

Errors

Documented error codes: GE-1010, AUTH-1030.

HTTP 400

Invalid key or unauthorized.

Unsupported key value

{
  "Message": "GE-1010 - Invalid http method - GET or api resource - <requestId>"
}

Missing permissions

{
  "Message": "AUTH-1030 - User is not authorized to perform this action"
}

HTTP 500

Internal server error.