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 | ||||
---|---|---|---|---|
|
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
...
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/topologyv1/administration/security/user?userName=fdadmin To search by first name and last name:http://host:port/flexdeploy/rest/topologyv1/administration/security/user?firstName=John&lastName=Smith To search by group idhttp://host:port/flexdeploy/rest/topologyv1/administration/security/user?groupId=11101 |
...
Include Page | ||||
---|---|---|---|---|
|
Example
...
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
...
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 | The ids of the groups that the user is a member ofProvide 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 | ||||
---|---|---|---|---|
|
Example
If the POST request receives the following JSON user object,
...
theme | Eclipse |
---|---|
title | User - 10000 |
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 | ||||
---|---|---|---|---|
| ||||
{ "userName": "username", "password": "password", "email": "email@company.com", "lastName": "Last", "firstName": "First" } |
...
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/v1/administration/security/user/{Id} |
...
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 | The ids of the groups that the user is a member ofProvide 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
...
http://host:port/flexdeploy/rest/v1/administration/security/user/10000
...
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} |
...
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 | The ids of the groups that the user is a member ofProvide 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
...
http://host:port/flexdeploy/rest/v1/administration/security/user/10000
...