POST api/v7/UserRoles
Add a user to an org unit with a role. Please note that ** API supports multiple job codes per user. This will be supported by the POS in a future release. **
Tables Impacted
OrgUnitUser
Request Information
URI Parameters
None.
Body Parameters
The User ID, Org Name, Role Code, and a flag indicating if the Org Unit is the primary unit for the user.
User Role Update RequestName | Description | Type | Required? | Additional information |
---|---|---|---|---|
userId * |
User ID |
string |
Yes |
String length: between 1 and 32, inclusive |
orgName * |
Organization Name |
string |
Conditional |
Conditionally required: If removing a user's role from UserRole API, this is required. String length: between 1 and 50, inclusive |
roleCode * |
Unique code identifying User Role |
string |
Yes |
String length: between 1 and 64, inclusive |
isPrimaryOrgUnit |
Flag Determining if its primary Organization unit |
boolean |
No |
None. |
customerAuditDate |
Last modified audit information |
date |
No |
None. |
Request Formats
application/json, text/json
{ "userId": "8001", "orgName": "111", "roleCode": "50", "isPrimaryOrgUnit": false, "customerAuditDate": "2018-01-01T00:00:00" }
application/xml, text/xml
<UserRoleUpdateRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <userId>8001</userId> <orgName>111</orgName> <roleCode>50</roleCode> <isPrimaryOrgUnit>false</isPrimaryOrgUnit> <customerAuditDate>2018-01-01T00:00:00</customerAuditDate> </UserRoleUpdateRequest>
Response Information
Resource Description
HTTP 200 OK or 202 Accepted
HttpResponseMessageName | Description | Type |
---|---|---|
Version | Version | |
Content | HttpContent | |
StatusCode | HttpStatusCode | |
ReasonPhrase | string | |
Headers | Collection of Object | |
RequestMessage | HttpRequestMessage | |
IsSuccessStatusCode | boolean |