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).

StatusDescription
200 - OKReturned if the request was completed successfully.
403 - ForbiddenReturned if request could not be completed (normally if the user still has data associated with them).
404 - NotFoundReturned if user does not exists.

Example - Delete existing User

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

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}96ED2FC6-BAB3-4AF3-9ADE-3C7039279A1DID of the user to delete

Response Headers

KeyValueDescription
Content-Typeapplication/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).

StatusDescription
200 - OKReturned if the request was completed successfully.
404 - NotFoundReturned if user does not exists.

Example - Get User

Example of fetching a user

Request Headers

KeyValueDescription
Acceptapplication/json

Response Headers

KeyValueDescription
Content-Typeapplication/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,
  "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).

StatusDescription
200 - OKReturned if the request was completed successfully.
403 - ForbiddenReturned if request contained invalid data or would cause a conflict with an existing user record.
404 - NotFoundReturned if user does not exists.

Example - Update existing User

Updating basic details of a user.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}96ED2FC6-BAB3-4AF3-9ADE-3C7039279A1DID of the user to update

Request Body

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

Response Headers

KeyValueDescription
Content-Typeapplication/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,
  "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

  • No labels