REST API - Update User Request

Updated by Stefenie Stockbridge

/api/v1/users

Description

Updates the specified properties of a specific user.

URL Structure

[Blueprint_URI]/api/v1/users

Supported Methods

Request Body

The artifact must be defined in the body of the request. Read more about how to define a user in the request body.

HTTP Status Codes

  • 201: Successfully Created
  • 207: Partially Successful
    • Some of the users could not be created. Refer to the codes in the response for the reason for each unsuccessfully added user:
      • 1192: A required value is missing or invalid: username, display name, first name, last name, password.
      • 1193: The user was created, but could not be added to a group.
      • 1194: The assigned Instance Administrator role does not exist.
  • 400: Bad Request
    This error can occur for a variety of reasons:
    • At least one URI or request body parameter is invalid, such as one of the Filter, Traces, Offset or Limit parameters.
    • A required value has not been provided.
    • If you are submitting a POST or PATCH request and have not added the X-HTTP-Method-Override parameter to your request header.
  • 401: Unauthorized
    • The Blueprint token is missing, invalid or expired.
  • 403: Forbidden
    • The applicable permissions are needed. For example, this error can occur when:
      • An Author or Collaborate license is needed for access.
      • Comment permissions are needed on the artifact.
      • Edit permissions are needed on the change summary job.
  • 409: Conflict
    • Reason for failure can be found in the response body. Additional information may also be found in the log.

Examples

XML Example

Request URI

https://production.blueprintcloud.com/api/v1/users

Request Body

(Modifies user title and department created in "create user" example)

<?xml version="1.0" ?>
<Users xmlns="http://www.blueprintsys.com/blueprint/api/v1">
<User>
<Email>dquade2084@dev.recall.com</Email>
<Department>R&D</Department>
<Name>dquade</Name>
<Enabled>true</Enabled>
<GroupIds xmlns:i="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<i:int>1</i:int>
<i:int>8</i:int>
<i:int>12</i:int>
</GroupIds>
<Title>Senior Engineer</Title>
</User>
</Users>

Response Body

<UserUpdateResults xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.blueprintsys.com/blueprint/api/v1">
<UserUpdateResult>
<Message>User information has been updated successfully</Message>
<ResultCode>200</ResultCode>
<User>
<Email>dquade2084@dev.recall.com</Email>
<Department>R&D</Department>
<DisplayName>quaaade</DisplayName>
<Enabled>false</Enabled>
<Firstname>Douglas</Firstname>
<Groups />
<Id>3754</Id>
<Lastname>Quade</Lastname>
<Name>dquade</Name>
<Title>Senior Engineer</Title>
</User>
</UserUpdateResult>
</UserAddResults>
JSON Example

Request URI

https://production.blueprintcloud.com/api/v1/users

Request Body

(Modifies user title and department created in "create user" example)

[
{
"Type": "User",
"Name": "dquade",
"DisplayName": "quaaade",
"Firstname": "Douglas",
"Lastname": "Quade",
"GroupIds": [
"1",
"8",
"12"
],
"Title": "Senior Engineer",
"Department": "RandD",
"Password": "#fR33m4R5",
"Enabled": true,
"Email": "dquade2084@dev.recall.com"
}
]

Response Body

[
{
"User": {
"Type": "User",
"Id": 1040,
"Name": "dquade_jtest",
"DisplayName": "quaaade_jtest",
"Firstname": "Douglas",
"Lastname": "Quade",
"Groups": [
{
"Type": "Group",
"Id": 1,
"Name": "authorized"
},
{
"Type": "Group",
"Id": 8,
"Name": "Gen Mgrs"
},
{
"Type": "Group",
"Id": 12,
"Name": "sysgen group 1"
}
],
"Title": "Senior Engineer",
"Department": "RandD",
"Enabled": true,
"Email": "dquade2084@dev.recall.com"
},
"Message": "User information has been updated successfully",
"ResultCode": 200
}
]


How did we do?