POST api/users/{id}/role?reassign={reassign}&autoAddRole={autoAddRole}&caseSensitiveRole={caseSensitiveRole}

Create a new role for a User (Available to Admin Accounts Only)

Request Information

URI Parameters

NameDescriptionTypeAdditional information
id

the unique id of the user

integer

Required

reassign

Sets what to do with items already assigned to this user. "role" will assign back to the original role, "user" will keep it assigned to this user but update the role to this new role

string

Default value is role

autoAddRole

If role does not exist then it will be added automatically to the list of roles

boolean

Default value is True

caseSensitiveRole

If true, the role must match an existing role exactly including case. If false, it'll match an existing role even if the case isn't an exact match.

boolean

Default value is False

Body Parameters

The role to add to the users profile

RoleDTO
NameDescriptionTypeAdditional information
name

Role Name

string

None.

FTE

Full time equivalent

string

None.

actualCost

Actual Cost of this user (e.g. Salary)

string

None.

startDate

Date user will start at this role, only relevent for a role change.

date

None.

daysAvailable

Days User will be working at this role, format as mon|tue|wed|thu|fri|sat|sun with only relevant days supplied

string

None.

utilisation

Target Billable ( number between 0-100 )

string

None.

Request Formats

application/json, text/json

Sample:
{
  "name": "sample string 1",
  "FTE": "sample string 2",
  "actualCost": "sample string 3",
  "startDate": "2024-12-22T06:15:37.2100677+00:00",
  "daysAvailable": "sample string 5",
  "utilisation": "sample string 6"
}

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'RoleDTO'.

Response Information

Resource Description

IHttpActionResult

None.

Response Formats

application/json, text/json

Sample:

Sample not available.