This URL updates the details of a user.
Resource URL
POST /user/{userId}
Request Parameters
URL Parameter
| Field Name | Description | Data Type | Mandatory |
|---|---|---|---|
| userId | Unique identifier of a user | Number | Yes |
Payload Request Parameters:
| Field Name | Description | Data Type |
|---|---|---|
| userCredentials | This field contains the user id and password details of the user. | Object |
| userDetails | This field contains general details like name, contact, etc. for a user. | Object |
| roleAssignment | This field contains the details about domain and role. | Object |
Details of userCredentials:
| Field Name | Description | Data Type | Mandatory |
|---|---|---|---|
| loginID | Unique identifier for a user | String | Yes |
| password | Secret key required to login. Its value will not be visible as it is confidential and should only be known to the user. | String | Yes |
Details of userDetails:
| Field Name | Description | Data Type | Mandatory |
|---|---|---|---|
| firstAndLastName | First and last name of the user | String | Yes |
| Email address of the user | String | Yes | |
| company | Company of the user | String | No |
| phone | Contact number of the user | String | No |
| address | Address of the user | Object | No |
| state | State to which user belongs to | String | No |
| country | Country to which user belongs to | String | No |
Details of address:
| Field Name | Description | Data Type | Mandatory |
|---|---|---|---|
| address1 | Address line 1 - Contains one segment of the user's address | String | No |
| address2 | Address line 2 - Contains other segment of the user's address | String | No |
Details of roleAssignment:
| Field Name | Description | Data Type | Mandatory |
|---|---|---|---|
| domainId | The domain in which the user was created | String | No |
| role | This field contains the information regarding the role assigned to the user. It can have any value from the list of roles already defined in the Manager, i.e.
|
String | No (In this case "No Role" will be assigned by default if no value is specified) |
Details of dashBoardAssignment:
| Field Name | Description | Data Type |
|---|---|---|
| dashBoardList | List of all the dashboards to be assigned to user | Array |
Response Parameters
Following fields are returned if the request parameters are correct, otherwise error details are returned.
| Field Name | Description | Data Type |
|---|---|---|
| status | Value 1 indicates resource is updated successfully | Number |
Example
Request
PUT https://<NSM_IP>/sdkapi/user/103
Payload
{
"userCredentials":
{
"loginID": "nsmuser",
"password": "nsmuser1234"
},
"userDetails":
{
"firstAndLastName": "NSM USER",
"email": "nsmuser@admin.com",
"company": "Intel Secutity",
"phone": "",
"address":
{
"address1": "Intel Security",
"address2": "Intel Security"
},
"state": "Karnataka",
"country": "India"
},
"roleAssignment":
{
"domainId": 0,
"role": " Security Expert"
},
"dashBoardAssignment":
{
"dashBoardList": ["Dashboard_1","Dashboard_2"]
}
}
Response
{
"status":1
}
Error Information
Following error codes are returned by this URL:
| No | HTTP Error Code | SDK API errorId | SDK API errorMessage |
|---|---|---|---|
| 1 | 400 | 5102 | Invalid login id provided |
| 2 | 400 | 5103 | Login id already in use |
| 3 | 400 | 5104 | Password is required |
| 4 | 400 | 5105 | Invalid password provided |
| 5 | 400 | 5106 | Name is required |
| 6 | 400 | 5107 | Email id is required |
| 7 | 400 | 5108 | Login id exceeding maximum length |
| 8 | 400 | 5109 | Password exceeding maximum length |
| 9 | 400 | 5111 | Domain cannot be changed |
| 10 | 400 | 5610 | Dashboard not available |