User

User

Resource: User ( /api/user/{id} )

Allows the retrieval of details for an individual user.

This resource supports the following methods: DELETE, GET, PUT

 

Methods

DELETE


Deletes an existing user (requires that the user have no data associated with them)

Required Permissions

  • Administration/Organisation/ManageUserAndGroupSecurity

Status Codes

These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

Status

Description

200 - OK

Returned if the request was completed successfully.

403 - Forbidden

Returned if request could not be completed (normally if the user still has data associated with them).

404 - NotFound

Returned if user does not exists.

 

Example - Delete existing User

 

Delete a user (that has no data associated with them in Enterprise Tester).

Request Headers

Key

Value

Description

Accept

application/json

 

Request Parameters

Key

Value

Description

{id}

96ED2FC6-BAB3-4AF3-9ADE-3C7039279A1D

ID of the user to delete

Response Headers

Key

Value

Description

Content-Type

application/json; charset=utf-8

 

Status Code

200 - OK

 

 

GET


Retrieves a single user by ID.

Supported Expansions

For more details on expansions, please see the Expand help topic.

Status Codes

These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

Status

Description

200 - OK

Returned if the request was completed successfully.

404 - NotFound

Returned if user does not exists.

 

Example - Get User

 

Example of fetching a user

Request Headers

Key

Value

Description

Accept

application/json

 

Response Headers

Key

Value

Description

Content-Type

application/json; charset=utf-8

 

Response Body

{ "Id": "96ed2fc6-bab3-4af3-9ade-3c7039279a1d", "UserName": "joeb", "Email": "joeb@unknown.net", "FirstName": "Joe", "LastName": "Bloggs", "Phone": "(09)-555-999", "LastLogIn": null, "Enabled": true, "IsExternal": false, "Self": "http://localhost/api/user/96ed2fc6-bab3-4af3-9ade-3c7039279a1d", "Links": [ { "Href": "http://localhost/api/user/96ed2fc6-bab3-4af3-9ade-3c7039279a1d/password", "Rel": "ChangePassword" }, { "Href": "http://localhost/api/user/96ed2fc6-bab3-4af3-9ade-3c7039279a1d/permissions/global", "Rel": "GlobalPermissions" }, { "Title": "Group Memberships", "Href": "http://localhost/api/user/96ed2fc6-bab3-4af3-9ade-3c7039279a1d/groups", "Rel": "Groups" }, { "Href": "http://localhost/api/user/96ed2fc6-bab3-4af3-9ade-3c7039279a1d/notifications", "Rel": "Notifications" }, { "Href": "http://localhost/api/user/96ed2fc6-bab3-4af3-9ade-3c7039279a1d/permissions/projects", "Rel": "ProjectPermissions" }, { "Href": "http://localhost/api/user/96ed2fc6-bab3-4af3-9ade-3c7039279a1d/mailmessages", "Rel": "MailMessages" } ] }

Status Code

200 - OK

 

 

PUT


Updates an existing user

Required Permissions

  • Administration/Organisation/ManageUserAndGroupSecurity

Status Codes

These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

Status

Description

200 - OK

Returned if the request was completed successfully.

403 - Forbidden

Returned if request contained invalid data or would cause a conflict with an existing user record.

404 - NotFound

Returned if user does not exists.

 

Example - Update existing User

 

Updating basic details of a user.

Request Headers

Key

Value

Description

Accept

application/json

 

Request Parameters

Key

Value

Description

{id}

96ED2FC6-BAB3-4AF3-9ADE-3C7039279A1D

ID of the user to update

Request Body

{ "UserName": "joeb", "Email": "joeb@unknown.net", "FirstName": "Joe", "LastName": "Bloggs", "Phone": "(09)-555-999" }

Response Headers

Key

Value

Description

Content-Type

application/json; charset=utf-8

 

Response Body

{ "Id": "96ed2fc6-bab3-4af3-9ade-3c7039279a1d", "UserName": "joeb", "Email": "joeb@unknown.net", "FirstName": "Joe", "LastName": "Bloggs", "Phone": "(09)-555-999", "LastLogIn": null, "Enabled": true, "IsExternal": false, "Self": "http://localhost/api/user/96ed2fc6-bab3-4af3-9ade-3c7039279a1d", "Links": [ { "Href": "http://localhost/api/user/96ed2fc6-bab3-4af3-9ade-3c7039279a1d/password", "Rel": "ChangePassword" }, { "Href": "http://localhost/api/user/96ed2fc6-bab3-4af3-9ade-3c7039279a1d/permissions/global", "Rel": "GlobalPermissions" }, { "Title": "Group Memberships", "Href": "http://localhost/api/user/96ed2fc6-bab3-4af3-9ade-3c7039279a1d/groups", "Rel": "Groups" }, { "Href": "http://localhost/api/user/96ed2fc6-bab3-4af3-9ade-3c7039279a1d/notifications", "Rel": "Notifications" }, { "Href": "http://localhost/api/user/96ed2fc6-bab3-4af3-9ade-3c7039279a1d/permissions/projects", "Rel": "ProjectPermissions" }, { "Href": "http://localhost/api/user/96ed2fc6-bab3-4af3-9ade-3c7039279a1d/mailmessages", "Rel": "MailMessages" } ] }

Status Code

200 - OK