Get users
/km/api/v1/users/{id}
This method returns a user object by a unique identifier. Currently, the unique identifiers are record Id or login.
Note: To find other user's user object, you either must have the VIEW_USER permission or you must be an administrator of the repository. You can get your own user object information with a unique identifier even if you do not have the VIEW_USER permission.
Example URI
The example URI for this method is as follows:
-
http://<IM_REST_API_HOST>/km/api/users/{id}
This request returns a User BO data object.
Response Error
The possible error response for this method is as follows:
- OK-SEC0001
The error occurs when a user does not have VIEW_USER permission but attempts to get a user object of another user.
Request
-
id: string
The unique identifier of the object to be retrieved.
Response
- application/json
- application/xml
200 Response
object
User
-
adminUser(optional):
boolean
AdminUser of the User object
-
alias(optional):
string
Alias of the User object
-
banUntilDate(optional):
string(date-time)
BanUntilDate of the User object
-
banUser(optional):
boolean
BanUser of the User object
-
canAuthorArticle(optional):
boolean
Returns whether this user can author contents in atleast one content type.
-
canReceiveEmailNotificationsForAssignedTasks(optional):
boolean
CanReceiveEmailNotificationsForAssignedTasks of the User object
-
canReceiveEmailNotificationsForTasksICanPerform(optional):
boolean
CanReceiveEmailNotificationsForTasksICanPerform of the User object
-
contentLocales(optional):
array contentLocales
To Many Relationship to Locale
-
customKeyValues(optional):
array customKeyValues
To Many Relationship to UserKeyValue
-
dataFormNotifications(optional):
array dataFormNotifications
To Many Relationship to Rating
-
dateAdded(optional):
string(date-time)
The date when the User object was created or added
-
dateModified(optional):
string(date-time)
The date when the User object was last modified.
-
defaultLocale(optional):
object LocaleKey
Title:
LocaleKey
-
defaultView(optional):
object ViewKey
Title:
ViewKey
-
email(optional):
string
Email of the User object
-
extendedProperties(optional):
string
ExtendedProperties of the User object
-
externalId(optional):
integer
The ExternalId is the Id of the corresponding User from an external system. It, along with ExternalType, can be used to bridge the gap between a User from this system and a User from an external system.
-
externalType(optional):
string
The ExternalType is the type of the corresponding User from an external system. It, along with ExternalId, can be used to bridge the gap between a User from this system and a User from an external system.
-
firstName(optional):
string
FirstName of the User object
-
hasValidSessionLocale(optional):
boolean
Returns whether this user has valid session km locale.
-
isActive(optional):
boolean
Returns whether this user is active or not. If a user is locked or inactive, this will return false * @return boolean true if user is active, false if user is locked or inactive * @since 8.3
-
isDefaultAdministrator(optional):
boolean
IsDefaultAdministrator of the User object
-
isLocked(optional):
boolean
Returns whether this user is locked or not. If a user is active or inactive, this will return false * @return boolean true if user is locked, false if user is active or inactive * @since 8.3
-
lastName(optional):
string
LastName of the User object
-
links(optional):
array links
-
login(optional):
string
Login of the User object
-
name(optional):
string
User's full name
-
recordId(optional):
string
The unique record ID of the User object.
-
reportingUserGroup(optional):
object UserGroupKey
Title:
UserGroupKey
-
reputationPoints(optional):
integer
ReputationPoints of the User object
-
securityRoles(optional):
array securityRoles
To Many Relationship to SecurityRole
-
showEmail(optional):
boolean
ShowEmail of the User object
-
showName(optional):
boolean
ShowName of the User object
-
skills(optional):
array skills
To Many Relationship to Category
-
subscribeOnTopicCreation(optional):
boolean
SubscribeOnTopicCreation of the User object
-
subscribeOnTopicReply(optional):
boolean
SubscribeOnTopicReply of the User object
-
subscriptions(optional):
array subscriptions
To Many Relationship to Subscription
-
subscriptionSchedule(optional):
integer
SubscriptionSchedule of the User object
-
userImage(optional):
string
UserImage of the User object
-
userType(optional):
Allowed Values:
[ "CONSOLE_USER", "WEB_USER", "INTEGRATION_USER" ]
Returns the Type for this user. Valid types are WEB_USER and CONSOLE_USER -
views(optional):
array views
To Many Relationship to View
-
workTeams(optional):
array workTeams
To Many Relationship to WorkTeam
array
-
Array of:
object LocaleKey
Title:
LocaleKey
array
-
Array of:
object UserKeyValueKey
Title:
UserKeyValueKey
array
-
Array of:
object RatingKey
Title:
RatingKey
object
LocaleKey
-
links(optional):
array links
-
recordId(optional):
string
The unique identifier of the Locale object.
object
ViewKey
-
links(optional):
array links
-
name(optional):
string
Localized name of the view
-
recordId(optional):
string
GUID of the SITE table containing the view definition
-
referenceKey(optional):
string
Non localized reference key for the view
-
stripeCD(optional):
string
Stripe of a view
array
-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
object
UserGroupKey
-
externalId(optional):
integer
The unique identifier of the corresponding userGroup from an external system. You can use the External ID with the ExternalType parameter to connect user groups in the internal and the the external systems.
-
externalType(optional):
string
The ExternalType is the type of the corresponding userGroup from an external system.
-
links(optional):
array links
-
name(optional):
string
The localized name of the user group. The name field can only be used for sorting.
-
recordId(optional):
string
The unique identifier from the TAG table that represent a userGroups resource
-
referenceKey(optional):
string
The non localized name of the user group
-
stripeCD(optional):
string
Stripe for UserGroup
array
-
Array of:
object SecurityRoleKey
Title:
SecurityRoleKey
array
-
Array of:
object CategoryKey
Title:
CategoryKey
array
-
Array of:
object SubscriptionKey
Title:
SubscriptionKey
array
-
Array of:
object ViewKey
Title:
ViewKey
array
-
Array of:
object WorkTeamKey
Title:
WorkTeamKey
object
UserKeyValueKey
-
links(optional):
array links
-
recordId(optional):
string
The unique identifier that represents a userKeyValue resource.
array
-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
object
-
href:
string
URI [RFC3986] or URI Template [RFC6570]. If the value is set to URI Template, then the "templated" property must be set to true.
-
mediaType(optional):
string
Media type, as defined by RFC 2046, describing the link target.
-
method(optional):
string
HTTP method for requesting the target of the link.
-
profile(optional):
string
Link to the metadata of the resource, such as JSON-schema, that describes the resource expected when dereferencing the target resource..
-
rel:
string
Name of the link relation that, in addition to the type property, can be used to retrieve link details. For example, href or profile.
-
templated(optional):
boolean
Boolean flag that specifies that "href" property is a URI or URI Template. If the property is a URI template, set this value to true. By default, this value is false.
object
RatingKey
-
links(optional):
array links
-
name(optional):
string
Localized display name for the Rating
-
recordId(optional):
string
GUID for the Rating
-
referenceKey(optional):
string
The non localized reference key for the Rating
array
-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
array
-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
array
-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
array
-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
object
SecurityRoleKey
-
externalId(optional):
integer
The ExternalId is the Id of the corresponding role from an external system. It, along with ExternalType, can be used to bridge the gap between a security role from this system and a object from an external system. When in RightNow mode, the external Id represents the RightNow profile Id, only when the external type is set to RN_PROFILE. The external Id can also represent the RightNow access Id, only when the external type is set to RN_WEB_ROLE.
-
externalType(optional):
string
The ExternalType is the type of the corresponding role from an external system. It, along with ExternalId, can be used to bridge the gap between a security role from this system and a object from an external system. When in RightNow mode, the only types allowed are RN_PROFILE and RN_WEB_ROLE.
-
links(optional):
array links
-
recordId(optional):
string
GUID of the SECURITYROLE table
-
referenceKey(optional):
string
Non localized name of the security role
-
roleType(optional):
Allowed Values:
[ "SITE_ADMINISTRATOR_ROLE", "SUPER_ADMIN", "SUPER_SUPPORT", "CONSOLE_ROLE", "WEB_ROLE", "INTEGRATION_ROLE" ]
Returns the Type for this security role. Valid types are web roles and console roles
array
-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
object
CategoryKey
-
childrenCount(optional):
integer
This field will return number of immediate children a category has.
This field will only be populated if childrenCount query parameter is passed in with value true.
Example URIs for the this parameter are as follows:
- http://<IM_REST_API_HOST>/km/api/categories/{id}?childrenCount=true&mode=KEY
- http://<IM_REST_API_HOST>/km/api/categories?childrenCount=true&mode=KEY
- http://<IM_REST_API_HOST>/km/api/categories?q=contentTypeRefKey eq 'FAQ'&childrenCount=true&mode=KEY
-
description(optional):
string
Description of the Category object
-
externalId(optional):
integer
The unique identifier used while integrating the repository data with the external system.
-
externalType(optional):
string
The type of the category used while integrating the repository data with the external system. Valid options are PRODUCT and CATEGORY.
-
inventoryOrgId(optional):
integer
The inventory organization id of the specific product.
-
links(optional):
array links
-
name(optional):
string
The name of the category.
-
objectId(optional):
string
The hierarchichal position of the category
-
parents(optional):
array parents
This field will return all parents of category.
This field will only be populated if withParents query parameter is passed in with value true.
Example URIs for the this parameter are as follows:
- http://<IM_REST_API_HOST>/km/api/categories/{id}?withParents=true&mode=KEY
- http://<IM_REST_API_HOST>/km/api/categories?withParents=true&mode=KEY
- http://<IM_REST_API_HOST>/km/api/categories?q=contentTypeRefKey eq 'FAQ'&withParents=true&mode=KEY
- http://<IM_REST_API_HOST>/km/api/categories/{id}?childrenCount=true&withParents=true&mode=KEY
-
recordId(optional):
string
The unique record ID of the Category object.
-
referenceKey(optional):
string
The reference key for the Category object. Category objects support multiple languages. This field can be used to identify the associated objects for all languages.
-
responseLocale(optional):
string
This is a custom field that will get populated if a name is translated into the default locale when the translated name is not found.
array
-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
array
This field will return all parents of category.
This field will only be populated if withParents query parameter is passed in with value true.
Example URIs for the this parameter are as follows:
- http://<IM_REST_API_HOST>/km/api/categories/{id}?withParents=true&mode=KEY
- http://<IM_REST_API_HOST>/km/api/categories?withParents=true&mode=KEY
- http://<IM_REST_API_HOST>/km/api/categories?q=contentTypeRefKey eq 'FAQ'&withParents=true&mode=KEY
- http://<IM_REST_API_HOST>/km/api/categories/{id}?childrenCount=true&withParents=true&mode=KEY
-
Array of:
object CategoryKey
Title:
CategoryKey
object
SubscriptionKey
-
links(optional):
array links
-
recordId(optional):
string
The unique record ID of the Subscription object.
array
-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
object
WorkTeamKey
-
links(optional):
array links
-
recordId(optional):
string
The unique record ID of the WorkTeam object.
-
referenceKey(optional):
string
The reference key for the WorkTeam object. WorkTeam objects support multiple languages. This field can be used to identify the associated objects for all languages.
array
-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
Examples
The following example shows how to find a User object by a unique identifier by submitting a get request on the REST resource using cURL.
cURL Command Example
curl -X GET "https://<IM_REST_API_HOST>/km/api/latest/users/{id}" -u "<username:password>" -H "Accept: application/json" -H "Content-Type: application/json"
Example of Response Body
The following shows an example of the response body in JSON format.
{ "skills": [], "customKeyValues": [], "contentLocales": [], "securityRoles": [], "subscriptions": [], "dataFormNotifications": [], "views": [], "workTeams": [], "userType": "CONSOLE_USER", "recordId": "62AE91CBB23A49668BC7B9A220B696C7", "name": "NAME_VALUE", "externalType": "ACCOUNT", "links": [ { "rel": "canonical", "href": "http://IM_REST_API_HOST/km/api/latest/users/62AE91CBB23A49668BC7B9A220B696C7", "mediaType": "application/json, application/xml", "method": "GET" }, { "rel": "collection", "href": "http://IM_REST_API_HOST/km/api/latest/users", "mediaType": "application/json, application/xml", "method": "GET", "profile": "http://IM_REST_API_HOST/km/api/latest/metadata-catalog/users" } ], "isActive": false, "isLocked": false, "adminUser": true, "alias": "ALIAS_VALUE", "banUser": false, "dateAdded": "2017-03-16T09:11:58-0500", "dateModified": "2017-03-16T09:11:58-0500", "email": "EMAIL_VALUE", "firstName": "FIRSTNAME_VALUE", "isDefaultAdministrator": true, "lastName": "LASTNAME_VALUE", "login": "LOGIN_VALUE", "canReceiveEmailNotificationsForAssignedTasks": false, "canReceiveEmailNotificationsForTasksICanPerform": false, "reputationPoints": 0, "showEmail": true, "showName": true, "subscribeOnTopicCreation": true, "subscribeOnTopicReply": true, "subscriptionSchedule": -1, "defaultLocale": { "recordId": "en_US", "links": [ { "rel": "canonical", "href": "http://IM_REST_API_HOST/km/api/latest/locales/en_US", "mediaType": "application/json, application/xml", "method": "GET" } ] } }