User
user is a resource which represents the asset users of Transition Manager.
Get Users (GET /api/user)
A GET request that will list the users as JSON.
Request Parameters
| Parameter | Required | Description |
|---|---|---|
max |
|
The max number or results 5,10,25,50,100 |
offset |
|
The offset in pages(page number x max) |
sort |
|
The column to sort by id, username, enabled, accountExpired, accountLocked, passwordExpired, dateCreated, or lastUpdated. Defaults to id |
order |
|
The order to sort by ace or desc. Defaults to ace |
username |
|
An optional filter by username |
enabled |
|
An optional filter by enabled flag. |
accountExpired |
|
An optional filter by account expired flag. |
accountLocked |
|
An optional filter by account locked flag. |
passwordExpired |
|
An optional filter by password expired flag. |
Request Headers
| Name | Description |
|---|---|
|
Bearer token, from login endpoint. |
|
This should always be application/json. |
Example request
GET /api/user?username=me&enabled=true HTTP/1.1
Authorization: Bearer 12345
Accept: application/json
Content-Type: application/json; charset=UTF-8
Host: api.restdocs.com
$ curl 'http://api.restdocs.com/api/user?username=me&enabled=true' -i -X GET \
-H 'Authorization: Bearer 12345' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json; charset=UTF-8'
Response structure
| Path | Type | Required | Description |
|---|---|---|---|
total |
Number |
|
The name of the User |
data.[].id |
Number |
|
The id of the User |
data.[].username |
String |
|
The name of the User |
data.[].enabled |
Boolean |
|
Is the user enabled. |
data.[].accountExpired |
Boolean |
|
Is the user account expired. |
data.[].accountLocked |
Boolean |
|
Is the account locked. |
data.[].passwordExpired |
Boolean |
|
Is the users password expired. |
data.[].dateCreated |
String |
|
The date the User was created in ISO 8601 format. |
data.[].lastUpdated |
String |
|
The date the User was last updated in ISO 8601 format. |
Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Language: en-US
Transfer-Encoding: chunked
Date: Mon, 28 Jun 2021 04:51:58 GMT
Keep-Alive: timeout=60
Connection: keep-alive
Content-Length: 519
{
"total" : 2,
"data" : [ {
"id" : 4,
"dateCreated" : "2021-06-28T04:51:56Z",
"passwordExpired" : false,
"username" : "me",
"lastUpdated" : "2021-06-28T04:51:56Z",
"accountLocked" : false,
"accountExpired" : false,
"enabled" : true
}, {
"id" : 5,
"dateCreated" : "2021-06-28T04:51:56Z",
"passwordExpired" : false,
"username" : "me2",
"lastUpdated" : "2021-06-28T04:51:56Z",
"accountLocked" : false,
"accountExpired" : false,
"enabled" : true
} ]
}
Get user (GET /api/user/$id)
A GET request that will get a user, as JSON.
Request Parameters
| Parameter | Description |
|---|---|
|
The id of the User to fetch. |
Request Headers
| Name | Description |
|---|---|
|
Bearer token, from login endpoint. |
|
This should always be application/json. |
Example request
GET /api/user/4 HTTP/1.1
Authorization: Bearer 12345
Accept: application/json
Content-Type: application/json; charset=UTF-8
Host: api.restdocs.com
$ curl 'http://api.restdocs.com/api/user/4' -i -X GET \
-H 'Authorization: Bearer 12345' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json; charset=UTF-8'
Response structure
| Path | Type | Required | Description |
|---|---|---|---|
id |
Number |
|
The id of the User |
username |
String |
|
The name of the User |
enabled |
Boolean |
|
Is the user enabled. |
accountExpired |
Boolean |
|
Is the user account expired. |
accountLocked |
Boolean |
|
Is the account locked. |
passwordExpired |
Boolean |
|
Is the users password expired. |
dateCreated |
String |
|
The date the User was created in ISO 8601 format. |
lastUpdated |
String |
|
The date the User was last updated in ISO 8601 format. |
Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Language: en-US
Transfer-Encoding: chunked
Date: Mon, 28 Jun 2021 04:51:58 GMT
Keep-Alive: timeout=60
Connection: keep-alive
Content-Length: 223
{
"id" : 4,
"dateCreated" : "2021-06-28T04:51:56Z",
"passwordExpired" : false,
"username" : "me",
"lastUpdated" : "2021-06-28T04:51:56Z",
"accountLocked" : false,
"accountExpired" : false,
"enabled" : true
}
Create user (POST /api/user)
A POST request will create a new user.
Request Parameters/JSON body
| Path | Type | Required | Description |
|---|---|---|---|
username |
String |
|
The name of the User. |
password |
String |
|
A description of the User. |
enabled |
Boolean |
|
The color of the User. |
accountExpired |
Boolean |
|
The project associated with the User. |
accountLocked |
Boolean |
|
The name of the User. |
passwordExpired |
Boolean |
|
A description of the User. |
{
"username" : "Test_User",
"password" : "password",
"enabled" : true,
"accountExpired" : false,
"accountLocked" : false,
"passwordExpired" : false
}
Request Headers
| Name | Description |
|---|---|
|
Bearer token, from login endpoint. |
|
This should always be application/json. |
Example request
POST /api/user HTTP/1.1
Authorization: Bearer 12345
Accept: application/json
Content-Type: application/json; charset=UTF-8
Host: api.restdocs.com
Content-Length: 161
{
"username" : "Test_User",
"password" : "password",
"enabled" : true,
"accountExpired" : false,
"accountLocked" : false,
"passwordExpired" : false
}
$ curl 'http://api.restdocs.com/api/user' -i -X POST \
-H 'Authorization: Bearer 12345' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json; charset=UTF-8' \
-d '{
"username" : "Test_User",
"password" : "password",
"enabled" : true,
"accountExpired" : false,
"accountLocked" : false,
"passwordExpired" : false
}'
Response structure
| Path | Type | Required | Description |
|---|---|---|---|
id |
Number |
|
The id of the User |
username |
String |
|
The name of the User |
enabled |
Boolean |
|
Is the user enabled. |
accountExpired |
Boolean |
|
Is the user account expired. |
accountLocked |
Boolean |
|
Is the account locked. |
passwordExpired |
Boolean |
|
Is the users password expired. |
dateCreated |
String |
|
The date the User was created in ISO 8601 format. |
lastUpdated |
String |
|
The date the User was last updated in ISO 8601 format. |
Example response
HTTP/1.1 201 Created
Content-Type: application/json;charset=UTF-8
Content-Language: en-US
Transfer-Encoding: chunked
Date: Mon, 28 Jun 2021 04:51:58 GMT
Keep-Alive: timeout=60
Connection: keep-alive
Content-Length: 230
{
"id" : 6,
"dateCreated" : "2021-06-28T04:51:59Z",
"passwordExpired" : false,
"username" : "Test_User",
"lastUpdated" : "2021-06-28T04:51:59Z",
"accountLocked" : false,
"accountExpired" : false,
"enabled" : true
}
Update user (PUT /api/user/$id)
A PUT request will update a user.
Request Parameters/JSON body
| Path | Type | Required | Description |
|---|---|---|---|
username |
String |
|
The name of the User. |
password |
String |
|
A description of the User. |
enabled |
Boolean |
|
The color of the User. |
accountExpired |
Boolean |
|
The project associated with the User. |
accountLocked |
Boolean |
|
The name of the User. |
passwordExpired |
Boolean |
|
A description of the User. |
{
"username" : "Test User",
"password" : "password1",
"enabled" : true,
"accountExpired" : false,
"accountLocked" : false,
"passwordExpired" : false
}
Request Headers
| Name | Description |
|---|---|
|
Bearer token, from login endpoint. |
|
This should always be application/json. |
Example request
PUT /api/user/6 HTTP/1.1
Authorization: Bearer 12345
Accept: application/json
Content-Type: application/json; charset=UTF-8
Host: api.restdocs.com
Content-Length: 162
{
"username" : "Test User",
"password" : "password1",
"enabled" : true,
"accountExpired" : false,
"accountLocked" : false,
"passwordExpired" : false
}
$ curl 'http://api.restdocs.com/api/user/6' -i -X PUT \
-H 'Authorization: Bearer 12345' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json; charset=UTF-8' \
-d '{
"username" : "Test User",
"password" : "password1",
"enabled" : true,
"accountExpired" : false,
"accountLocked" : false,
"passwordExpired" : false
}'
Response structure
| Path | Type | Required | Description |
|---|---|---|---|
id |
Number |
|
The id of the User |
username |
String |
|
The name of the User |
enabled |
Boolean |
|
Is the user enabled. |
accountExpired |
Boolean |
|
Is the user account expired. |
accountLocked |
Boolean |
|
Is the account locked. |
passwordExpired |
Boolean |
|
Is the users password expired. |
dateCreated |
String |
|
The date the User was created in ISO 8601 format. |
lastUpdated |
String |
|
The date the User was last updated in ISO 8601 format. |
Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Language: en-US
Transfer-Encoding: chunked
Date: Mon, 28 Jun 2021 04:51:58 GMT
Keep-Alive: timeout=60
Connection: keep-alive
Content-Length: 230
{
"id" : 6,
"dateCreated" : "2021-06-28T04:51:59Z",
"passwordExpired" : false,
"username" : "Test_User",
"lastUpdated" : "2021-06-28T04:51:59Z",
"accountLocked" : false,
"accountExpired" : false,
"enabled" : true
}
Delete user (DELETE /api/user/$id)
A DELETE request that will delete a user.
Request Parameters
| Parameter | Description |
|---|---|
|
The id of the User to delete. |
Request Headers
| Name | Description |
|---|---|
|
Bearer token, from login endpoint. |
|
This should always be application/json. |
Example request
DELETE /api/user/6 HTTP/1.1
Authorization: Bearer 12345
Accept: application/json
Content-Type: application/json; charset=UTF-8
Host: api.restdocs.com
$ curl 'http://api.restdocs.com/api/user/6' -i -X DELETE \
-H 'Authorization: Bearer 12345' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json; charset=UTF-8'
Example response
HTTP/1.1 204 No Content
Date: Mon, 28 Jun 2021 04:51:58 GMT
Keep-Alive: timeout=60
Connection: keep-alive