PATCH User/{id}
Some tooltip text!
• 9 minutes to read
• 9 minutes to read
PATCH /api/v1/User/{id}
Update a User with changes, as described in a JSON Patch or a JSON Merge Patch document.
Online Restricted: ## The User agent is not available in Online by default. User management is not allowed for partner apps. Update the Department field to "foo" can be done either as a JSON PATCH:
[ { "op": "replace", "path": "/Department", "value": "foo" } ]
or as a JSON MERGE PATCH, which describes the change directly:
{ "Department": "foo" }
JSON PATCH supports operations 'add', 'replace', 'remove' and 'test'. The path is case insensitive, and the leading slash is optional, so the paths "/department", "Department" and "department" are all equivalent.
Calls the {SuperOffice.CRM.Services.IUserAgent} service SaveUser.
Path Part | Type | Description |
---|---|---|
id | int32 | The User id to update. Required |
Query String Parameters
Parameter Name | Type | Description |
---|---|---|
$select | string | Optional comma separated list of properties to include in the result. Other fields are then nulled out to reduce payload size: "Name,department,category" Default = show all fields. |
PATCH /api/v1/User/{id}?$select=name,department,category/id
Request Headers
Parameter Name | Description |
---|---|
Authorization | Supports 'Basic', 'SoTicket' and 'Bearer' schemes, depending on installation type. |
X-XSRF-TOKEN | If not using Authorization header, you must provide XSRF value from cookie or hidden input field |
Content-Type | Content-type of the request body: |
Accept | Content-type(s) you would like the response in: application/json , text/json , application/xml , text/xml , application/json-patch+json , application/merge-patch+json |
Accept-Language | Convert string references and multi-language values into a specified language (iso2) code. |
SO-Language | Convert string references and multi-language values into a specified language (iso2) code. Overrides Accept-Language value. |
SO-Culture | Number, date formatting in a specified culture (iso2 language) code. Partially overrides SO-Language/Accept-Language value. Ignored if no Language set. |
SO-TimeZone | Specify the timezone code that you would like date/time responses converted to. |
SO-AppToken | The application token that identifies the partner app. Used when calling Online WebAPI from a server. |
Request Body: changes
JSON-Patch array of operations+path+value, or a MERGE-PATCH object (which will be converted to a list of JSON-PATCH operations).
Property Name | Type | Description |
---|---|---|
op | String | "add", "replace", "remove", "test" "move" and "copy" not supported |
path | String | The property names to modify. "/users/0/email", "/users/-", |
value | Object | New/Replaced value - string or object. |
Response:
User updated.
Response | Description |
---|---|
200 | User updated. |
404 | User with given id does not exist in the db. |
409 | Update blocked because a 'test' operation has detected a conflict with the entity value. |
412 | Update aborted because User has changed since the requested If-Unmodified-Since timestamp. |
Response body: UserWithLinks
Property Name | Type | Description |
---|---|---|
AssociateId | int32 | Primary key |
Name | string | Initials, UserId - also used as login name for on-site installations. Identifies user in archives. |
Rank | int32 | Rank order |
Tooltip | string | Tooltip or other description |
LicenseOwners | array | The restricted and unrestricted module licenses grouped by license owner. These module licenses are either assigned or unassigned to this user |
Role | Role | Users role for role-based security. Determines permissions and access rights for the user. |
UserGroup | UserGroup | The main user group that this user belongs to. Use MDO List name "usergroup" to get list items. |
OtherGroups | array | The other groups this user is a member of, apart from the main user group. Use MDO List name "usergroup" to get list items. |
Person | Person | The person associated with this user. Detailed information about the user Use MDO List name "person_new" to get list items. |
Deleted | bool | If true, the user is retired and should have no rights, not appear in lists, etc. |
Lastlogin | date-time | Last login date |
Lastlogout | date-time | Last logout date |
EjUserId | int32 | ID of the ej user record corresponding to this associate; 0 for associates that are not ej users |
RequestSignature | string | ej users request signature |
Type | string | User type: 1=InternalAssociate, 2=ResourceAssociate, 3=ExternalAssociate, 4=AnonymousAssociate, 5=SystemAssociate |
IsPersonRetired | bool | True if the user is retired and should have no rights, not appear in lists, etc. |
IsOnTravel | bool | True if the user is on travel. |
Credentials | array | List of credentials registered for this user. i.e. valid authentication methods. |
UserName | string | User name, a.k.a. Login name. This might be an e-mail address. |
TicketCategories | array | Request Ticket Categories assigned to the user. Use MDO List name "ejCategory" to get list items. |
NickName | string | The unique nick name for this user. Used in Service as an alias, similar to Name/Initials. |
WaitingForApproval | bool | The user is waiting for an administrator to approve/grant her/him access. |
ExtraFields | object | Deprecated: Use {SuperOffice.CRM.Services.User.CustomFields} instead. Extra fields added to the carrier. This could be data from Plug-ins, the foreign key system, external applications, etc. |
CustomFields | object | Udef + Extra fields added to the carrier. Extra fields as defined by changes to database schema + user-defined fields as defined by admin. Custom fields combines user defined fields and extra fields into one bucket. The individual {SuperOffice.CRM.Services.User.ExtraFields} and UserDefinedFields properties are deprecated in favor of this combined collection. |
PostSaveCommands | array | Post custom commands the client should execute after save has completed. |
TableRight | TableRight | The carrier's table right |
FieldProperties | object | Field property dictionary mapping field names to field access rights. |
_Links | object |
Sample request
PATCH /api/v1/User/{id}
Authorization: Basic dGplMDpUamUw
Accept: application/json; charset=utf-8
Accept-Language: en
Content-Type: application/json; charset=utf-8
[
{
"op": "add",
"path": "aperiam",
"value": {}
},
{
"op": "add",
"path": "aperiam",
"value": {}
}
]
Sample response
HTTP/1.1 200 User updated.
Content-Type: application/json; charset=utf-8
{
"AssociateId": 70,
"Name": "Cormier Group",
"Rank": 119,
"Tooltip": "minus",
"LicenseOwners": [
{
"Name": "Kovacek, Kris and Williamson",
"Description": "Reverse-engineered demand-driven model",
"RestrictedModuleLicenses": [
{},
{}
],
"UnrestrictedModuleLicenses": [
{},
{}
],
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 152
}
}
},
{
"Name": "Kovacek, Kris and Williamson",
"Description": "Reverse-engineered demand-driven model",
"RestrictedModuleLicenses": [
{},
{}
],
"UnrestrictedModuleLicenses": [
{},
{}
],
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 152
}
}
}
],
"Role": null,
"UserGroup": null,
"OtherGroups": [
{
"Value": "deserunt",
"Tooltip": "culpa",
"Id": 697,
"Rank": 54,
"Deleted": false,
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 777
}
}
}
],
"Person": null,
"Deleted": false,
"Lastlogin": "2014-07-14T17:54:08.7418072+02:00",
"Lastlogout": "2015-05-15T17:54:08.7418072+02:00",
"EjUserId": 562,
"RequestSignature": "sit",
"Type": "AnonymousAssociate",
"IsPersonRetired": false,
"IsOnTravel": false,
"Credentials": [
{
"Type": null,
"Value": "dolorum",
"DisplayValue": "fugit",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 499
}
}
},
{
"Type": null,
"Value": "dolorum",
"DisplayValue": "fugit",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 499
}
}
}
],
"UserName": "Lockman-Abshire",
"TicketCategories": [
{
"Id": 51,
"Name": "Schneider, Cole and Kuvalis",
"ToolTip": "Ut a magnam minima.",
"Deleted": false,
"Rank": 371,
"Type": "perspiciatis",
"ChildItems": [
{},
{}
],
"IconHint": "quaerat",
"ColorBlock": 838,
"ExtraInfo": "vero",
"StyleHint": "voluptatem",
"FullName": "Dr. Eduardo Ewald Doyle",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 559
}
}
}
],
"NickName": "Vandervort-Pfeffer",
"WaitingForApproval": true,
"ExtraFields": {
"ExtraFields1": "neque",
"ExtraFields2": "omnis"
},
"CustomFields": {
"CustomFields1": "illo",
"CustomFields2": "aut"
},
"PostSaveCommands": [
{
"Name": "Marquardt Inc and Sons",
"DisplayName": "Herzog-Gusikowski",
"Description": "Digitized demand-driven internet solution",
"ToolTip": "Earum qui dolorum ex culpa quo quia velit.",
"Actions": "Implicit",
"ActionData": "quis",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.String",
"FieldLength": 519
}
}
}
],
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 383
}
},
"_Links": {
"Self": "https://www.example.com/api/v1/project/321",
"Archive": "https://www.example.com/api/v1/project"
}
}