Users REST API

Use this REST API to manage users.

Get all users

Table 1. Get all users
REST API information Value Description
URI /admin/resources/users  
Method GET  
Returns 200 Returns a list of all users
404 The user list was not found
500 Platform System Manager encountered an internal error while processing the request.

Returns a list of users.

You can use optional parameters to modify the response from the REST API call. For more information, see the Related information section.

Response body

[
   {
      "deployment_options": "F",
      "created_time_raw": 1465936201000,
      "bidi_national_calendar": null,
      "state": "available",
      "updated_time": "Fri 17 Jun 2016 20:52:16.181 UTC",
      "version": "2.2.2.0",
      "id": "/admin/resources/users/66056922-3a86-4e58-883f-229f2be969ca",
      "user_extras": [
         "/admin/resources/user_extras/5e525e4b-25ab-485c-9117-8ee0a245b240"
      ],
      "full_cloud_group": "T",
      "user_groups": [
         "/admin/resources/user_groups/cde0b993-6652-4e06-bdab-6f87ad5422a3"
      ],
      "name": "Default Admin",
      "bidi_text_direction": null,
      "is_internal": "F",
      "user_id": "admin",
      "current_message": null,
      "auth_mode": "internal",
      "isas_rn": 1,
      "label_text": "User",
      "label_key": "pure8500",
      "current_status": null,
      "updated_time_raw": 1466196736181,
      "email": null,
      "roles": [
         "/admin/resources/roles/7f02c942-deae-40fb-a006-1999f7f4621c",
         "/admin/resources/roles/7201879e-6e2f-440c-95c2-824c4f19a68c",
         "/admin/resources/roles/a7455b0c-7eb7-4177-93ee-812d1dc2b24e",
         "/admin/resources/roles/b412ed58-cc0d-4d1b-868e-a8b7b10a4e6b",
         "/admin/resources/roles/0e03aea0-b097-45d6-afa2-760d6a5efd60",
         "/admin/resources/roles/a44593ad-0d6b-4aae-94ae-3084979bcc03",
         "/admin/resources/roles/1d36fe64-c888-45b8-aaf8-fbb5f2bc0bf7",
         "/admin/resources/roles/710fb414-85cf-4b4e-bd24-874b955da4bc",
         "/admin/resources/roles/84578858-1bc1-4d1f-aad6-fba093a70aa6",
         "/admin/resources/roles/bd7493ee-3a63-4719-a857-759c2211bed6",
         "/admin/resources/roles/5599486b-b9e2-461f-a71a-fd1fcee07643",
         "/admin/resources/roles/bf61abbf-5b54-440f-961a-7f49fe1ab729",
         "/admin/resources/roles/374448ab-9311-4ce1-9f7a-16fc7fbd08bd",
         "/admin/resources/roles/4bd1bc4d-a77d-4751-955c-a9dcd353d568",
         "/admin/resources/roles/6554b306-79f7-4066-94bd-92a37599ec9b",
         "/admin/resources/roles/4d32967c-928b-44b0-a11e-0fa9d955ad13",
         "/admin/resources/roles/7074d8fe-2c9c-4a77-8106-ab47b63df165",
         "/admin/resources/roles/0995b098-cfa1-43d0-912f-b073902d24c8",
         "/admin/resources/roles/3a959d23-8d14-4d4f-b8e8-bc4e8e312dfd",
         "/admin/resources/roles/5c2b10b1-15f7-4b73-9652-e0b47323e362",
         "/admin/resources/roles/ee9ab2d3-91cb-41ac-b9d3-73d9b01f3351",
         "/admin/resources/roles/348020a3-e746-4f5b-8a21-74b663c49688",
         "/admin/resources/roles/e1c607dc-4ea1-4ea1-960e-357cafa02f69",
         "/admin/resources/roles/cfa9d8cb-1887-468c-8ed3-9645229cce66",
         "/admin/resources/roles/59bc5dca-2385-4aae-806c-a0c69268b22f",
         "/admin/resources/roles/d34d8e5e-d22d-4d91-a85c-2dd348028369",
         "/admin/resources/roles/d93ae97d-76a4-4865-97fe-28ab77a07440",
         "/admin/resources/roles/afda657e-c7f7-415f-b546-b17c703308e4",
         "/admin/resources/roles/e99c07b2-855c-4e9b-9c0f-4fb80afe0085",
         "/admin/resources/roles/712df94c-b9e3-4cbd-bab9-a36105035c39",
         "/admin/resources/roles/8e79ac40-ec4a-436b-a6be-b3516cfabcbf"
      ],
      "acls": [
         "/admin/resources/acls/9a897895-d876-47fc-8269-31d88761a3c6",
         "/admin/resources/acls/0ab4e34d-6e8c-4c45-a872-12496bfeb23e",
         "/admin/resources/acls/4e06cfa0-4019-46ec-868b-e9132c2b9392",
         "/admin/resources/acls/f9aa028e-d001-41b8-bb15-2e905766df80",
         "/admin/resources/acls/bd0b25cf-b000-4ab3-9bbe-fcfcecdd2980",
         "/admin/resources/acls/96aeae42-2ed5-48f8-89d5-55a7cfcf31fb",
         "/admin/resources/acls/8b598049-542d-4a61-9670-cfc76558ab1c",
         "/admin/resources/acls/b9922084-37c3-4b3f-b439-261617fe060e"
      ],
      "is_disabled": "F",
      "created_time": "Tue 14 Jun 2016 20:30:01.000 UTC"
   }
]
auth_mode
Authentication mode of the user, either ldap or internal user repository
created_time
The time at which the object is created
current_message
The current message for the user
current_status
The current status of the user
deployment_options
Flag indicating the scope of users' deployment capabilities range from Cloud only, Environment profile only, to All.
email
User's email address
id
The unique ID of the object in the system.
is_disabled
Flag indicating if the user is disabled or not
is_internal
Flag indicating if the user is an internal one or not
label_key
Key for retrieving label for the user
label_text
Default translated message text
name
User's name
public_key
The public key for the user
roles
The roles of the user
state
The general availability of the object. If "pending" the object has been created but not activated. If "available" the object is active in the system.
updated_time
The time at which the object was last updated
user_extras
The modifiable extra data for the user
user_id
The ID of the user. The user ID must be unique within the system

Children:

acls

Get a specific user

Table 2. Get a specific user
REST API information Value Description
URI /admin/resources/users/{id}  
Method GET  
Returns 200 The user was returned.
404 The user was not found
500 Platform System Manager encountered an internal error while processing the request.

Returns a single user identified by {id}.

You can use optional parameters to modify the response from the REST API call. For more information, see the Related information section.

Create a user

Table 3. Create a user
REST API information Value Description
URI /admin/resources/users/{id}  
Method POST  
Returns 201 The user has been defined and is included in the response body. The URL of the new user is included in the Location header of the response.
400 This code is returned if there are problems parsing the JSON data in the request
403 This code is returned if the requester does not have sufficient permission to define a new user
500 This code is returned if Cloud Pak System encountered an internal error while processing the request.

You can use optional parameters to modify the response from the REST API call. For more information, see the Related information section.

Request body

 {
"auth_mode": "internal",  
"name": "testNewE",  
"email": "testNewE@us.ibm.com", 
"user_id": "testNewE", 
"password": "mypassword"
}

Response body

{
   "currentmessage": "RM02013",
   "currentmessage_text": "User has not logged in yet",
   "currentstatus": "RM01062",
   "currentstatus_text": "Inactive",
   "email": "testNewE@us.ibm.com",
   "fullname": "New User",
   "groups": [
      "/resources/groups/1"
   ],
   "id": 3,
   "user_extras": [
   ],   
   "patterns": [
   ],
   "user_id": "newuser",
   "virtualsystems": [
   ]
}

Lock and unlock a user

Table 4. Lock and unlock a user
REST API information Value Description
URI /admin/resources/users/{id}  
Method PUT  
Returns 202 The user has been locked or unlocked.
400 An invalid request body was provided.
403 The requester does not have sufficient permissions to lock or unlock a user.
404 The user was not found.
500 An internal error occurred while processing the request.

You can use optional parameters to modify the response from the REST API call. For more information, see the Related information section.

Request body

To lock a user:
{"locked":"T"}
To unlock a user without changing password:
{"locked":"F"}
To unlock a user and change password:
{"locked":"F", "password":"newPW"}

Response body

The contents of user_extras data is returned:
{
"users": "/admin/resources/users/312c5985-767b-4262-aac2-d66b3da44b26",
"locked_time_raw": -1,
"failed_login_first_time_raw": 0,
"label_text": "Extra User Data",
"event_message": "User account is unlocked. user_extras data entry updated.",
"id": "/admin/resources/user_extras/054f70c4-cb4d-48aa-a09b-9521b1c9777e",
"failed_login_count": 0,
"pw_set_time_raw": 1394133857680,
"user_id": "testNewE"
}