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.
Base URL for User REST API
Each function returns a JSON user object. The user object has these attributes:
Attributes | Type | Description |
---|---|---|
userId | Long | The id of the user |
attributes | List<Attribute> | The list of attributes associated with the user |
userName | String | The user name of the user |
password | String | The user's password. Note: this value is displayed as "*****" when retrieved. |
groups | List<Long> | The ids of the groups that the user is a member of |
isLocalUser | Boolean | Whether or not the user was made in FlexDeploy |
isActive | Boolean | Whether or not the user is active |
String | The user's email | |
firstName | String | The first name of the user |
lastName | String | The last name of the user |
Additionally, each attribute in the list of attributes contains these attributes
Attributes | Type | Description |
---|---|---|
description | String | The description of the attribute |
attributeName | String | The name of the attribute |
attributeValue | String | The value of the attribute |
attributeGroup | String | The group that the attribute is associated with |
attributeDataType | String | The type of data that the value is |
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.
API URL
http://host:port/flexdeploy/rest/administration/security/user/{Id}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
Id | URL | Yes | This is a URL parameter for the Id which is used to find and return a user |
Example
If we had a user in our database with an Id of 10000 and had the following attributes
{ "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": [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/10000
The GET request would return the following JSON user object
{ "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": [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.
API URLs
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 id
http://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
The query parameters are not case sensitive. Searching by userName=NAME is the same as searching by userName=name.
Parameters
Attributes | Type | Required | Description |
---|---|---|---|
userId | Long | No | The id of the user. This id is set when creating and returned in the JSON. |
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 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 |
Example
If we had a user in our database with an Id of 10000 and had the following attributes
{ "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": [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
[ { "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": [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.
Parameters
Attributes | Type | Required | Description |
---|---|---|---|
userId | Long | No | The id of the user. This id is set when creating and returned in the JSON. |
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 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 |
Example
If the POST request receives the following JSON user object,
{ "userName": "username", "password": "password", "email": "email@company.com", "lastName": "Last", "firstName": "First" }
The following user object will then be created as a new row in the database.
{ "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.
{ "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 |
---|---|---|---|
Id | URL | Yes | This is a URL parameter for the Id which is used to find and return an environment with. |
description | String | No | This is the description that the environment's description will be updated to. |
instances | List<Long> | No | This is the list of Instance Ids that will be assigned to the environment that is being updated. |
isActive | Boolean | Yes | This is the isActive boolean that the environment's isActive boolean will be updated to. |
environmentCode | String | Yes | This is the Code that the environment's Code will be updated to. |
sortNumber | Integer | Yes | This is the sort number that the environment's sort number will be updated to. |
environmentId | Long | Yes | This is the Id place holder. This Id will not be updated in the environment. |
isBuildEnvironment | Boolean | Yes | This is the isBuildEnvironment boolean that the environment's isBuildEnvironment boolean will be updated to. |
environmentName | String | Yes | This is the name that the environment's name will be updated to. |
Example
If we had an environment in our database with an Id of 11101 and had the following attributes
{ "description": "This is Environment 1" "instances": [15100], "isActive": true, "environmentCode": "ENV1", "sortNumber": 1, "environmentId": 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,
{ "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
{ "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.
Parameters
Parameters | Type | Required | Description |
---|---|---|---|
Id | URL | Yes | This is a URL parameter for the Id which is used to find and return an environment with. |
description | String | No | This is the description that the environment's description will be updated to. |
instances | List<Long> | No | This is the list of instance Ids that will be assigned to the environment that is being updated. |
isActive | Boolean | No | This is the isActive boolean that the environment's isActive boolean will be updated to. |
environmentCode | String | No | This is the code that the environment's code will be update to. |
sortNumber | Integer | No | This is the sort number that the environment's sort number will be updated to. |
environmentId | Long | No | This is the Id place holder. It will not change the environment's Id that is being updated. |
isBuildEnvironment | Boolean | No | This is the isActive boolean that the environment's isActive boolean will be updated to. |
environmentName | String | No | This is the name that the environment's name will be updated to. |
Example
If we had an environment in our database with an Id of 11101 and had the following attributes
{ "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,
{ "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
{ "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" }