Update a user
Description
The Update() method is used to update a user.
Package Details
Interface
IUserManager
Syntax
await userManager.Update(User user, bool excludeCoordinates = false)
Returns
Task<User>
API
POST
/api/v1/users
...
Parameters
Parameter | Description | Parameter Type |
---|---|---|
userDTO | UserDTO | Request body |
excludeCoordinates (optional) | Set excludeCoordinates to true to exclude coordinates information | Request body |
...
Code Block |
---|
{ "FirstName": "string", "LastName": "string", "GCKey": { "MBUN": "string", "Issuer": "string" }, "WindowsUserName": "string", "Verified": true, "PKI": "string", "AuthenticationType": "Anonymous", "Id": 0, "Phones": [ { "Id": 0, "LocalNumber": "string", "AreaCode": "string", "CountryCode": "string", "ExtensionNumber": "string", "InternationalAccessNumber": "string", "InternationalNumber": "string", "LocationType": "Business", "IsPrimary": true, "PhoneType": "Landline", "DisplayPhoneNumber": "string" } ], "Emails": [ { "Id": 0, "LocationType": "Business", "IsPrimary": true, "EmailAddress": "string" } ], "Addresses": [ { "Id": 0, "LocationType": "Business", "IsPrimary": true, "CoordinateType": "Mail", "SubAddressType": "string", "FloorSectionNumber": "string", "SuiteApartmentNumber": "string", "StreetCivicNumber": "string", "StreetName": "string", "PostalZipCode": "string", "BuildingName": "string", "StreetDirection": "None", "StreetType": "None", "CountryCode": 0, "CountrySubdivisionCode": "string", "DeliveryInstallationArea": "string", "DeliveryInstallQualifier": "string", "GenDeliveryCategory": "string", "RouteServiceType": "string", "BoxNumber": "string", "RouteServiceNumber": "string", "UnregisteredCityTownName": "string", "DeliveryDirective": "string", "GeneratedStreetAddress": "string", "CityTown": "string", "CityTownName": "string" } ] } |
Returns
On success, 200 Ok
On error, 400 Bad Request
On authorization error, 403 Forbidden
Example
Code Block | ||
---|---|---|
| ||
int userId = 1;
var user = _userManager.GetById(userId);
user.LastName = "Doe";
var updatedUser = _userManager.Update(user); |