Allows you to edit a user. It is validated that the user’s token corresponds to that of the user to be modified or that of a specialist user.
Petition Details
- URI: api/v8.6/user/{id}/update
- Type: POST
-
Required headings:
- content-type: application/json
- Authorization: TOKEN
Parameters
| Name | Data type | Obligatory | Description |
|---|---|---|---|
| Id | Number | Yes | User ID |
| FullName | Text | No | User’s full name |
| Text | No | ||
| Photo | Text | No | Photo |
| Telephone | Number | No | Telephone |
| Telephone2 | Number | No | Telephone |
| Telephone3 | Number | No | Telephone |
| Address | Text | No | Address |
| Address2 | Text | No | Address |
| Address3 | Text | No | Address |
| Commentary | Text | No | Comment |
| Fax | Text | No | Fax |
| Charge | Text | No | Charge |
| UserState | Number | No | User Status (User Status field in Profile) |
| NumberDepId | Number | No | Department ID |
| BirthDate | Text | No | Date of birth in dd/mm/yyyy format |
| IdentityType | Text | No | User document type |
| Document | Text | No | User document number |
| AdditionalField1 | Text | No | Additional field |
| AdditionalField2 | Text | No | Additional field |
| AdditionalField3 | Text | No | Additional field |
| AdditionalField4 | Text | No | Additional field |
| AdditionalField5 | Text | No | Additional field |
| AdditionalField6 | Text | No | Additional field |
| AdditionalField7 | Text | No | Additional field |
| AdditionalField8 | Text | No | Additional field |
| AdditionalField9 | Text | No | Additional field |
| AdditionalField10 | Text | No | Additional field |
| Building | Number | No | Building |
| Floor | Number | No | Floor |
| CodDept | Number | No | Department Code |
| Extension | Text | No | Department Code |
| Celphone | Text | No | Cell phone number |
| Country | Number | No | Country Id |
| CompanyId | Number | No | Company ID |
| Site | Number | No | Site |
| City | Number | No | City |
| Latitude | Text | No | Latitude |
| Length | Text | No | Longitude |
| CodeInmediateBoss | Number | No | Immediate Boss User Code |
| Role | Number | No | Role (1=Specialists, 2=Normal User, 3=Specialist and Normal). It can only be modified by users with a specialist role. |
| UserActive | Number | No | Active user (1=Active, 0=Inactive). It can only be modified by users with a specialist role. |
| ExpirationDate | dateTime | No | User expiration date in dd/mm/yyyy format. It can only be modified by users with a specialist role. |
| ProfileId | Number | No | Profile ID. It can only be modified by users with a specialist role. |
| CodeProfile | Number | No | Profile code (User workgroup in Profile). It can only be modified by users with a specialist role. |
| ProjectId | Number | No | Project ID. It is not allowed to be updated, it is used to validate the user’s mandatory fielding. |
Important: The user’s ID must be in the URL of the request.
Remarks:
• The UserName and Password fields are not editable.
Body of the petition
In Field you can go any of the parameters described above
[
{"Field":"ADDRESS", "Value":"Nueva direccion"}
]
Answer
The service will return a boolean indicating whether the operation could have been performed: Example: true
Error messages
| Code | HTTP status | Error Message |
|---|---|---|
| 400 | BadRequest | InvalidUserId |
| 400 | BadRequest | InvalidUserData |
| 400 | BadRequest | InvalidFullName |
| 400 | BadRequest | InvalidEmail |
| 400 | BadRequest | InvalidPhoto |
| 400 | BadRequest | InvalidTelephone |
| 400 | BadRequest | InvalidTelephone2 |
| 400 | BadRequest | InvalidTelephone3 |
| 400 | BadRequest | InvalidAddress |
| 400 | BadRequest | InvalidAddress2 |
| 400 | BadRequest | InvalidAddress3 |
| 400 | BadRequest | InvalidCommentary |
| 400 | BadRequest | InvalidFax |
| 400 | BadRequest | InvalidCharge |
| 400 | BadRequest | InvalidUserState |
| 400 | BadRequest | InvalidNumberDepId |
| 400 | BadRequest | InvalidIdentityType |
| 400 | BadRequest | InvalidIdentityNumber |
| 400 | BadRequest | InvalidAdditionaltField1 |
| 400 | BadRequest | InvalidAdditionaltField2 |
| 400 | BadRequest | InvalidAdditionaltField3 |
| 400 | BadRequest | InvalidAdditionaltField4 |
| 400 | BadRequest | InvalidAdditionaltField5 |
| 400 | BadRequest | InvalidAdditionaltField6 |
| 400 | BadRequest | InvalidAdditionaltField7 |
| 400 | BadRequest | InvalidAdditionaltField8 |
| 400 | BadRequest | InvalidAdditionaltField9 |
| 400 | BadRequest | InvalidAdditionaltField10 |
| 400 | BadRequest | InvalidBuilding |
| 400 | BadRequest | InvalidFloor |
| 400 | BadRequest | InvalidCodDepto |
| 400 | BadRequest | InvalidCelPhone |
| 400 | BadRequest | InvalidExtension |
| 400 | BadRequest | InvalidCountry |
| 400 | BadRequest | InvalidCompanyId |
| 400 | BadRequest | InvalidSite |
| 400 | BadRequest | InvalidLatitude |
| 400 | BadRequest | InvalidLogitude |
| 400 | BadRequest | InvalidCodeInmediateBoss |
| 400 | BadRequest | InvalidCodeProfile |
| 400 | BadRequest | InvalidProfileId |
| 400 | BadRequest | InvalidExpirationDate |
| 400 | BadRequest | InvalidRole |
| 400 | BadRequest | InvalidStatus |
| 401 | Unauthorized | Unauthorized |
| 500 | InternalServerError | FailureParseUser |
| 500 | InternalServerError | FailureUpdateUser |