Home

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

false

The max number or results 5,10,25,50,100

offset

false

The offset in pages(page number x max)

sort

false

The column to sort by id, username, enabled, accountExpired, accountLocked, passwordExpired, dateCreated, or lastUpdated. Defaults to id

order

false

The order to sort by ace or desc. Defaults to ace

username

false

An optional filter by username

enabled

false

An optional filter by enabled flag.

accountExpired

false

An optional filter by account expired flag.

accountLocked

false

An optional filter by account locked flag.

passwordExpired

false

An optional filter by password expired flag.

Request Headers

Name Description

Authorization

Bearer token, from login endpoint.

Accept

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

true

The name of the User

data.[].id

Number

true

The id of the User

data.[].username

String

true

The name of the User

data.[].enabled

Boolean

true

Is the user enabled.

data.[].accountExpired

Boolean

true

Is the user account expired.

data.[].accountLocked

Boolean

true

Is the account locked.

data.[].passwordExpired

Boolean

true

Is the users password expired.

data.[].dateCreated

String

true

The date the User was created in ISO 8601 format.

data.[].lastUpdated

String

true

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

Table 1. /api/user/{id}
Parameter Description

id

The id of the User to fetch.

Request Headers

Name Description

Authorization

Bearer token, from login endpoint.

Accept

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

true

The id of the User

username

String

true

The name of the User

enabled

Boolean

true

Is the user enabled.

accountExpired

Boolean

true

Is the user account expired.

accountLocked

Boolean

true

Is the account locked.

passwordExpired

Boolean

true

Is the users password expired.

dateCreated

String

true

The date the User was created in ISO 8601 format.

lastUpdated

String

true

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

true

The name of the User.

password

String

true

A description of the User.

enabled

Boolean

false

The color of the User.

accountExpired

Boolean

false

The project associated with the User.

accountLocked

Boolean

false

The name of the User.

passwordExpired

Boolean

false

A description of the User.

{
  "username" : "Test_User",
  "password" : "password",
  "enabled" : true,
  "accountExpired" : false,
  "accountLocked" : false,
  "passwordExpired" : false
}

Request Headers

Name Description

Authorization

Bearer token, from login endpoint.

Accept

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

true

The id of the User

username

String

true

The name of the User

enabled

Boolean

true

Is the user enabled.

accountExpired

Boolean

true

Is the user account expired.

accountLocked

Boolean

true

Is the account locked.

passwordExpired

Boolean

true

Is the users password expired.

dateCreated

String

true

The date the User was created in ISO 8601 format.

lastUpdated

String

true

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

true

The name of the User.

password

String

true

A description of the User.

enabled

Boolean

false

The color of the User.

accountExpired

Boolean

false

The project associated with the User.

accountLocked

Boolean

false

The name of the User.

passwordExpired

Boolean

false

A description of the User.

{
  "username" : "Test User",
  "password" : "password1",
  "enabled" : true,
  "accountExpired" : false,
  "accountLocked" : false,
  "passwordExpired" : false
}

Request Headers

Name Description

Authorization

Bearer token, from login endpoint.

Accept

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

true

The id of the User

username

String

true

The name of the User

enabled

Boolean

true

Is the user enabled.

accountExpired

Boolean

true

Is the user account expired.

accountLocked

Boolean

true

Is the account locked.

passwordExpired

Boolean

true

Is the users password expired.

dateCreated

String

true

The date the User was created in ISO 8601 format.

lastUpdated

String

true

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

Table 2. /api/user/{id}
Parameter Description

id

The id of the User to delete.

Request Headers

Name Description

Authorization

Bearer token, from login endpoint.

Accept

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

App Version

User