...
...
...
...
...
...
...
Users can be accessed and modified through this API using four services: GET, POST, PUT, and PATCH. These four services allow for the retrieval, creation, complete update, and partial update of users.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/administration/security/user |
Table of Contents | ||
---|---|---|
|
Each function returns a JSON user object. The user object has these attributes:
...
Additionally, each attribute in the list of attributes contains these attributes
...
GET
There are two implementations of GET. One will find a user with the given Id and return the JSON representation of the user . The other will find a list of users matching the parameters supplied to it.
GET by ID
This GET service will find a user with the given Id and return the JSON representation of the object.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/administration/security/user/{Id} |
Parameters
...
Parameter
...
Type
...
Required
...
Description
...
Id
...
Example
If we had a user in our database with an Id of 10000 and had the following attributes
...
theme | Eclipse |
---|---|
title | User - 10000 |
...
Users can be accessed and modified through this API using four services: GET, POST, PUT, and PATCH. These four services allow for the retrieval, creation, complete update, and partial update of users.
Include Page | ||||
---|---|---|---|---|
|
Table of Contents | ||
---|---|---|
|
GET
There are two implementations of GET. One will find a user with the given Id and return the JSON representation of the user . The other will find a list of users matching the parameters supplied to it.
GET by ID
This GET service will find a user with the given Id and return the JSON representation of the object.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/v1/administration/security/user/{Id} |
Request
Parameter | Type | Required | Description |
---|---|---|---|
Id | URL | Yes | This is a URL parameter for the Id which is used to find and return a user |
Include Page | ||||
---|---|---|---|---|
|
Response Codes
HTTP Code | Description |
---|---|
200 | User was found and returned |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | User not found |
500 | Unexpected internal server error |
Example
If we had a user in our database with an Id of 10000 and had the following attributes
Code Block | ||||
---|---|---|---|---|
| ||||
{ "attributes": [ { "description": "Notify on Approval Required", "attributeName": "SUBMITTER_PENDING_APPROVAL", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request Scheduled", "attributeName": "SUBMITTER_SCHEDULED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request Failed", "attributeName": "SUBMITTER_FAILED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request Deploying", "attributeName": "SUBMITTER_READY", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request Completed", "attributeName": "SUBMITTER_COMPLETED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request Rejected", "attributeName": "SUBMITTER_PENDING_APPROVALREJECTED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, {], "descriptionuserId": "Notify on Request Scheduled"10000, "attributeNameuserName": "SUBMITTER_SCHEDULEDusername", "attributeValuepassword": "truepassword", "attributeGroupgroups": "EMAIL_COMMUNICATION"[10010,10011], "attributeDataTypeisActive": "Boolean" }, { true, "descriptionemail": "Notify on Request Failedemail@company.com", "attributeNamelastName": "SUBMITTER_FAILEDLast", "attributeValuefirstName": "trueFirst", "attributeGroupisLocalUser": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, true } |
When we run a GET request at the following URL
http://host:port/flexdeploy/rest/v1/administration/security/user/10000
The GET request would return the following JSON user object
Code Block | ||||
---|---|---|---|---|
| ||||
{ "attributes": [ { "description": "Notify on RequestApproval DeployingRequired", "attributeName": "SUBMITTER_PENDING_READYAPPROVAL", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request CompletedScheduled", "attributeName": "SUBMITTER_COMPLETEDSCHEDULED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request RejectedFailed", "attributeName": "SUBMITTER_REJECTEDFAILED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, ],{ "userIddescription": "Notify 10000, "userName": "username", "passwordon Request Deploying", "attributeName": "passwordSUBMITTER_READY", "groupsattributeValue": [10010,10011], "isActive": true"true", "emailattributeGroup": "email@company.comEMAIL_COMMUNICATION", "lastNameattributeDataType": "LastBoolean" }, { "firstNamedescription": "FirstNotify on Request Completed", "isLocalUserattributeName": true } |
When we run a GET request at the following URL
http://host:port/flexdeploy/rest/administration/security/user/10000
The GET request would return the following JSON user object
Code Block | ||||
---|---|---|---|---|
| ||||
{ "attributes": [ { "description": "Notify on Approval Required", "attributeName": "SUBMITTER_PENDING_APPROVAL", "attributeValue": "true", ""SUBMITTER_COMPLETED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request ScheduledRejected", "attributeName": "SUBMITTER_SCHEDULEDREJECTED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, {], "descriptionuserId": "Notify on Request Failed"10000, "attributeNameuserName": "SUBMITTER_FAILEDusername", "attributeValuepassword": "true*****", "attributeGroupgroups": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }[10010,10011], { "descriptionisActive": "Notify on Request Deploying"true, "attributeNameemail": "SUBMITTER_READYemail@company.com", "attributeValuelastName": "trueLast", "attributeGroupfirstName": "EMAIL_COMMUNICATIONFirst", "attributeDataTypeisLocalUser": "Boolean"true }, { "description": "Notify on Request Completed", "attributeName": "SUBMITTER_COMPLETED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request Rejected", "attributeName": "SUBMITTER_REJECTED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" } ], "userId": 10000, "userName": "username", "password": "password", "groups": [10010,10011], "isActive": true, "email": "email@company.com", "lastName": "Last", "firstName": "First", "isLocalUser": true } |
GET (Using Query Parameters)
This GET service will return a list of users in the form of JSON objects based on the query parameters user name, first name, last name and group id. Users are only returned if they match all of the specified query parameters. If no query parameters are given this request will return the entire list of users.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/administration/security/user? Append the following character sequences to the above URL to specify Query parameters.Use '&' between successive query parameters:userName={userName} firstName={firstName} * lastName={lastName} * groupId={groupId} Examples:To search by user name only:http://host:port/flexdeploy/rest/topology/administration/security/user?userName=fdadmin To search by first name and last name:http://host:port/flexdeploy/rest/topology/administration/security/user?firstName=John&lastName=Smith To search by group idhttp://host:port/flexdeploy/rest/topology/administration/security/user?groupId=11101 |
* searching by first and last name returns all users that contain the specified string in their first or last name
Tip |
---|
The query parameters are not case sensitive. Searching by userName=NAME is the same as searching by userName=name. |
Parameters
...
Example
If we had a user in our database with an Id of 10000 and had the following attributes
Code Block | ||||
---|---|---|---|---|
| ||||
{ "attributes": [} |
GET (Using Query Parameters)
This GET service will return a list of users in the form of JSON objects based on the query parameters user name, first name, last name and group id. Users are only returned if they match all of the specified query parameters. If no query parameters are given this request will return the entire list of users.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/v1/administration/security/user? Append the following character sequences to the above URL to specify Query parameters.Use '&' between successive query parameters:userName={userName} firstName={firstName} * lastName={lastName} * groupId={groupId} Examples:To search by user name only:http://host:port/flexdeploy/rest/v1/administration/security/user?userName=fdadmin To search by first name and last name:http://host:port/flexdeploy/rest/v1/administration/security/user?firstName=John&lastName=Smith To search by group idhttp://host:port/flexdeploy/rest/v1/administration/security/user?groupId=11101 |
* searching by first and last name returns all users that contain the specified string in their first or last name
Request
Attributes | Type | Required | Description |
---|---|---|---|
groupId | Query - Long | No | Find users that are member of specific group |
userName | Query - String | No | Equals search |
firstName | Query - String | No | Contains ignore case search |
lastName | Query - String | No | Contains ignore case search |
Include Page | ||||
---|---|---|---|---|
|
Response Codes
HTTP Code | Description |
---|---|
200 | Search successful and results returned |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
500 | Unexpected internal server error |
Example
If we had a user in our database with an Id of 10000 and had the following attributes
Code Block | ||||
---|---|---|---|---|
| ||||
{ "attributes": [ { "description": "Notify on Approval Required", "attributeName": "SUBMITTER_PENDING_APPROVAL", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request Scheduled", "attributeName": "SUBMITTER_SCHEDULED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on ApprovalRequest RequiredFailed", "attributeName": "SUBMITTER_PENDING_APPROVALFAILED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request ScheduledDeploying", "attributeName": "SUBMITTER_SCHEDULEDREADY", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request FailedCompleted", "attributeName": "SUBMITTER_FAILEDCOMPLETED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request DeployingRejected", "attributeName": "SUBMITTER_READYREJECTED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, {], "descriptionuserId": "Notify on Request Completed"10000, "attributeNameuserName": "SUBMITTER_COMPLETEDusername", "attributeValuepassword": "truepassword", "attributeGroupgroups": "EMAIL_COMMUNICATION"[10010,10011], "attributeDataTypeisActive": "Boolean" }true, { "descriptionemail": "Notify on Request Rejectedemail@company.com", "attributeNamelastName": "SUBMITTER_REJECTEDLast", "attributeValuefirstName": "trueFirst", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" } ], "userId": 10000, "userName": "username", "password": "password", "groups": [10010,10011], "isActive": true, "email": "email@company.com", "lastName": "Last", "firstName": "First", "isLocalUser": true } |
When we run a GET request at the following URL
http://host:port/flexdeploy/rest/administration/security/user?groupId=10010
The GET request would return the following JSON environment object
Code Block | ||||
---|---|---|---|---|
| ||||
[ { "attributes": [ { "description": "Notify on Approval RequiredisLocalUser": true } |
When we run a GET request at the following URL
http://host:port/flexdeploy/rest/v1/administration/security/user?groupId=10010
The GET request would return the following JSON environment object
Code Block | ||||
---|---|---|---|---|
| ||||
[ { "attributes": [ { "description": "Notify on Approval Required", "attributeName": "SUBMITTER_PENDING_APPROVAL", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request Scheduled", "attributeName": "SUBMITTER_SCHEDULED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request Failed", "attributeName": "SUBMITTER_PENDING_APPROVALFAILED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request ScheduledDeploying", "attributeName": "SUBMITTER_SCHEDULEDREADY", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request FailedCompleted", "attributeName": "SUBMITTER_FAILEDCOMPLETED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request DeployingRejected", "attributeName": "SUBMITTER_READYREJECTED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, {], "descriptionuserId": "Notify on Request Completed"10000, "attributeNameuserName": "SUBMITTER_COMPLETEDusername", "attributeValuepassword": "true*****", "attributeGroupgroups": "EMAIL_COMMUNICATION"[10010,10011], "attributeDataTypeisActive": "Boolean" }true, { "descriptionemail": "Notify on Request Rejectedemail@company.com", "attributeNamelastName": "SUBMITTER_REJECTEDLast", "attributeValuefirstName": "trueFirst", "attributeGroupisLocalUser": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" true } ], "userId": 10000, "userName": "username", "password": "password", "groups": [10010,10011], "isActive": true, "email": "email@company.com", "lastName": "Last", "firstName": "First", "isLocalUser": true } ] |
POST
This POST service will create a new user with the same attributes as the given JSON object.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/administration/security/user |
Parameters
...
] |
POST
This POST service will create a new user with the same attributes as the given JSON object.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/v1/administration/security/user |
Request
Attributes | Type | Required | Description |
---|---|---|---|
attributes | List<Attribute> | No | The list of attributes associated with the user. They will be defaulted if not provided |
userName | String | Yes | The user name of the user |
password | String | Yes | The user's password. Note: this value is displayed as "*****" when retrieved. |
groups | List<Long> | No |
Provide list of group id that user should be member of. | |||
isLocalUser | Boolean | No | Whether or not the user was made in FlexDeploy. Set to true upon creation. |
isActive | Boolean | No | Whether or not the user is active. Defaulted to true if not provided. |
String | Yes | The user's email | |
firstName | String | Yes | The first name of the user |
lastName | String | Yes | The last name of the user |
Include Page | ||||
---|---|---|---|---|
|
Response Codes
HTTP Code | Description |
---|---|
201 | User was created |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
500 | Unexpected internal server error |
Example
If the POST request receives the following JSON user object,
...
Code Block | ||||
---|---|---|---|---|
| ||||
{ "attributes": [ { "description": "Notify on Approval Required", "attributeName": "SUBMITTER_PENDING_APPROVAL", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request Scheduled", "attributeName": "SUBMITTER_SCHEDULED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request Failed", "attributeName": "SUBMITTER_FAILED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request Deploying", "attributeName": "SUBMITTER_READY", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request Completed", "attributeName": "SUBMITTER_COMPLETED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" }, { "description": "Notify on Request Rejected", "attributeName": "SUBMITTER_REJECTED", "attributeValue": "true", "attributeGroup": "EMAIL_COMMUNICATION", "attributeDataType": "Boolean" } ], "userId": 10000, "userName": "username", "password": "password*****", "groups": [], "isActive": true, "email": "email@company.com", "lastName": "Last", "firstName": "First", "isLocalUser": true } |
...
PUT
This PUT service will update all attributes of a user with the given Id based on the attributes of a JSON object parameters. Attributes that are not provided will become their default values.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/v1/administration/security/user/{Id} |
Code Block | ||||
---|---|---|---|---|
| ||||
{
"description": "This is Put 1",
"instances": [15100],
"isActive": false,
"environmentCode": "PUT1",
"sortNumber": 6,
"environmentId": 00000,
"isBuildEnvironment": true,
"environmentName": "Put 1"
} |
Parameters
...
Parameters
...
Type
...
Required
...
Description
...
Example
...
Request
Attributes | Type | Required | Description |
---|---|---|---|
Id | URL | Yes | The PUT will be performed on the user with the specified id that is found in the URL. |
attributes | List<Attribute> | No | The list of attributes associated with the user. They will be defaulted if not provided |
userName | String | Yes | The user name of the user |
password | String | Yes | The user's password. Note: this value is displayed as "*****" when retrieved. |
groups | List<Long> | No | Provide list of group id that user should be member of. If user is already member of some group that is not part of input request, user will be removed from that group's membership. |
isLocalUser | Boolean | No | Whether or not the user was made in FlexDeploy. Cannot be changed. |
isActive | Boolean | No | Whether or not the user is active. Defaulted to true if not provided. |
String | Yes | The user's email | |
firstName | String | Yes | The first name of the user |
lastName | String | Yes | The last name of the user |
Include Page | ||||
---|---|---|---|---|
|
Response Codes
HTTP Code | Description |
---|---|
200 | User was found and updated |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | User not found |
500 | Unexpected internal server error |
Example
If we had a user in our database with an Id of 10000 and had the following attributes
Code Block | ||||
---|---|---|---|---|
| ||||
{ "attributes": [ { "description": "ThisNotify ison EnvironmentApproval 1Required" , "instancesattributeName": [15100], "isActive": trueSUBMITTER_PENDING_APPROVAL", "environmentCodeattributeValue": "ENV1false", "sortNumberattributeGroup": 1 "EMAIL_COMMUNICATION", "environmentIdattributeDataType": 11101, "isBuildEnvironment": true, "environmentName": "Env 1" } |
When we run a PUT request at the following URL
http://host:port/flexdeploy/rest/topology/environment/11101
And the PUT request receives the following JSON environment object,
Code Block | ||||
---|---|---|---|---|
| ||||
{
"description": "This is the updated Environment 1",
"instances": [15101],
"isActive": true,
"environmentCode": "PUT2",
"sortNumber": 2,
"environmentId": 11101,
"isBuildEnvironment": false,
"environmentName": "PUT 2"
} |
The PUT request would then update the environment with Id 11101 and return the following JSON environment object
Code Block | ||||
---|---|---|---|---|
| ||||
{
"description": "This is the updated Environment 1",
"instances": [15101],
"isActive": true,
"environmentCode": "PUT2",
"sortNumber": 2,
"environmentId": 11101,
"isBuildEnvironment": false,
"environmentName": "PUT 2"
} |
PATCH
This PATCH service will update an existing environment with the information passed through a JSON object. If an attribute of the JSON is null it will not be updated in the environment.
Info | ||
---|---|---|
| ||
Parameters
...
Parameters
...
Type
...
Required
...
Description
...
Example
If we had an environment in our database with an Id of 11101 and had the following attributes
Code Block | ||||
---|---|---|---|---|
| ||||
{
"description": "This is Environment 1",
"instances": [15101],
"isActive": true,
"environmentCode": "ENV1",
"sortNumber": 1,
"environmentId": 11101,
"isBuildEnvironment": false,
"environmentName": "Env 1"
} |
When we run a PATCH request at the following URL
http://host:port/flexdeploy/rest/topology/environment/11101
And the PATCH request receives the following JSON environment object,
Code Block | ||||
---|---|---|---|---|
| ||||
{
"description": "This is Patch with some null attributes",
"instances": [15102,15103],
"isActive": null,
"environmentCode": null,
"sortNumber": 7,
"environmentId": null,
"isBuildEnvironment": false,
"environmentName": "Patch with some null"
} |
The PATCH request would then update the environment with Id 11101 and return the following JSON environment object
Code Block | ||||
---|---|---|---|---|
| ||||
{
"description": "This is Patch with some null attributes",
"instances": [15102,15103],
"isActive": true,
"environmentCode": "ENV1",
"sortNumber": 7,
"environmentId": 11101,
"isBuildEnvironment": false,
"environmentName": "Patch with some null"
} |
...
"Boolean"
},
{
"description": "Notify on Request Scheduled",
"attributeName": "SUBMITTER_SCHEDULED",
"attributeValue": "false",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
},
{
"description": "Notify on Request Failed",
"attributeName": "SUBMITTER_FAILED",
"attributeValue": "false",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
},
{
"description": "Notify on Request Deploying",
"attributeName": "SUBMITTER_READY",
"attributeValue": "false",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
},
{
"description": "Notify on Request Completed",
"attributeName": "SUBMITTER_COMPLETED",
"attributeValue": "false",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
},
{
"description": "Notify on Request Rejected",
"attributeName": "SUBMITTER_REJECTED",
"attributeValue": "false",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
}
],
"userId": 10000,
"userName": "username",
"password": "password",
"groups": [],
"isActive": true,
"email": "email@company.com",
"lastName": "Last",
"firstName": "First",
"isLocalUser": true
} |
When we run a PUT request at the following URL
http://host:port/flexdeploy/rest/v1/administration/security/user/10000
And the PUT request receives the following JSON user object,
Code Block | ||||
---|---|---|---|---|
| ||||
{
"attributes": [
{
"description": "Notify on Approval Required",
"attributeName": "SUBMITTER_PENDING_APPROVAL",
"attributeValue": "false",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
}
],
"userName": "newusername",
"password": "password",
"groups": [],
"isActive": true,
"email": "newemail@company.com",
"lastName": "Lastname",
"firstName": "Firstname"
} |
The PUT request would then update the environment with Id 11101 and return the following JSON environment object
Code Block | ||||
---|---|---|---|---|
| ||||
{
"attributes": [
{
"description": "Notify on Approval Required",
"attributeName": "SUBMITTER_PENDING_APPROVAL",
"attributeValue": "false",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
},
{
"description": "Notify on Request Scheduled",
"attributeName": "SUBMITTER_SCHEDULED",
"attributeValue": "true",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
},
{
"description": "Notify on Request Failed",
"attributeName": "SUBMITTER_FAILED",
"attributeValue": "true",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
},
{
"description": "Notify on Request Deploying",
"attributeName": "SUBMITTER_READY",
"attributeValue": "true",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
},
{
"description": "Notify on Request Completed",
"attributeName": "SUBMITTER_COMPLETED",
"attributeValue": "true",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
},
{
"description": "Notify on Request Rejected",
"attributeName": "SUBMITTER_REJECTED",
"attributeValue": "true",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
}
],
"userId": 10000,
"userName": "newusername",
"password": "*****",
"groups": [],
"isActive": true,
"email": "newemail@company.com",
"lastName": "Lastname",
"firstName": "Firstname",
"isLocalUser": true
} |
PATCH
This PATCH service will update an existing user with the information passed through a JSON object. If an attribute of the JSON is null it will not be updated in the user. Groups that are included in a PATCH will be added, but existing groups will still remain.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/v1/administration/security/user/{Id} |
Request
Attributes | Type | Required | Description |
---|---|---|---|
Id | URL | Yes | The PUT will be performed on the user with the specified id that is found in the URL. |
attributes | List<Attribute> | No | The list of attributes associated with the user. Only provided attributes will be changed. |
userName | String | No | The user name of the user |
password | String | No | The user's password. Note: this value is displayed as "*****" when retrieved. |
groups | List<Long> | No | Provide list of group id that user should be made member of. Already existing membership is not updated. This is only additional membership. |
isLocalUser | Boolean | No | Whether or not the user was made in FlexDeploy. |
isActive | Boolean | No | Whether or not the user is active. |
String | No | The user's email | |
firstName | String | No | The first name of the user |
lastName | String | No | The last name of the user |
Include Page | ||||
---|---|---|---|---|
|
Response Codes
HTTP Code | Description |
---|---|
200 | User was found and updated |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | User not found |
500 | Unexpected internal server error |
Example
If we had an environment in our database with an Id of 11101 and had the following attributes
Code Block | ||||
---|---|---|---|---|
| ||||
{
"attributes": [
{
"description": "Notify on Approval Required",
"attributeName": "SUBMITTER_PENDING_APPROVAL",
"attributeValue": "false",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
},
{
"description": "Notify on Request Scheduled",
"attributeName": "SUBMITTER_SCHEDULED",
"attributeValue": "false",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
},
{
"description": "Notify on Request Failed",
"attributeName": "SUBMITTER_FAILED",
"attributeValue": "false",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
},
{
"description": "Notify on Request Deploying",
"attributeName": "SUBMITTER_READY",
"attributeValue": "false",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
},
{
"description": "Notify on Request Completed",
"attributeName": "SUBMITTER_COMPLETED",
"attributeValue": "false",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
},
{
"description": "Notify on Request Rejected",
"attributeName": "SUBMITTER_REJECTED",
"attributeValue": "false",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
}
],
"userId": 10000,
"userName": "username",
"password": "password",
"groups": [10001],
"isActive": true,
"email": "email@company.com",
"lastName": "Last",
"firstName": "First",
"isLocalUser": true
} |
When we run a PATCH request at the following URL
http://host:port/flexdeploy/rest/v1/administration/security/user/10000
And the PATCH request receives the following JSON user object,
Code Block | ||||
---|---|---|---|---|
| ||||
{
"attributes": [
{
"description": "Notify on Approval Required",
"attributeName": "SUBMITTER_PENDING_APPROVAL",
"attributeValue": "true",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
}
],
"password": "newPassword",
"groups": [10010]
} |
The PATCH request would then update the user with Id 10000 and return the following JSON user object
Code Block | ||||
---|---|---|---|---|
| ||||
{
"attributes": [
{
"description": "Notify on Approval Required",
"attributeName": "SUBMITTER_PENDING_APPROVAL",
"attributeValue": "true",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
},
{
"description": "Notify on Request Scheduled",
"attributeName": "SUBMITTER_SCHEDULED",
"attributeValue": "false",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
},
{
"description": "Notify on Request Failed",
"attributeName": "SUBMITTER_FAILED",
"attributeValue": "false",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
},
{
"description": "Notify on Request Deploying",
"attributeName": "SUBMITTER_READY",
"attributeValue": "false",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
},
{
"description": "Notify on Request Completed",
"attributeName": "SUBMITTER_COMPLETED",
"attributeValue": "false",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
},
{
"description": "Notify on Request Rejected",
"attributeName": "SUBMITTER_REJECTED",
"attributeValue": "false",
"attributeGroup": "EMAIL_COMMUNICATION",
"attributeDataType": "Boolean"
}
],
"userId": 10000,
"userName": "username",
"password": "*****",
"groups": [10001, 10010],
"isActive": true,
"email": "email@company.com",
"lastName": "Last",
"firstName": "First",
"isLocalUser": true
} |