Updates the user and returns the modified object.
PUT/api/v1/users/selfHeaders |
Authorization | Bearer token |
Accept | application/json |
X-Client | ios-cctv|android-cctv|thick-legal|web |
X-UUID | unique device id |
Body |
json | |
passwordoptional | string | New password for the user |
password_confirmationoptional | string | Re-enter the new password |
current_passwordoptional | string | Current password of the user |
languageoptional | string | User's language |
Response |
200 | Returns a JSON object representing the user |
JSON
{
"id": 13,
"login": "user",
"name": "user",
"parent_id": null,
"permissions": [
{
"id": 223,
"name": "any-permission"
},
{
"id": 221,
"name": "any-permission"
},
{
"id": 222,
"name": "any-permission"
},
{
"id": 220,
"name": "any-permission"
}
],
"created_at": "",
"updated_at": "2022-04-21 16:37:46",
"access_token_id": "c862e3c5a5a87d8b2756e4ad44a43f0a71cbf9cf3063cae019802d0b032ee17f32f69364e7aadb23",
"can_update_password": true,
"analytic_license": [
{
"type": "analytic_l1",
"type_pretty": "LIC-XXXX-YY-L1",
"all": 100,
"free": 98,
"used": 2
},
{
"type": "analytic_l2",
"type_pretty": "LIC-XXXX-YY-L2",
"all": 100,
"free": 100,
"used": 0
},
{
"type": "analytic_l3",
"type_pretty": "LIC-XXXX-YY-L3",
"all": 100,
"free": 99,
"used": 1
}
]
}
|
401 | Authorization token not provided or invalid, see Obtaining a token |
422 | Returns a JSON object with an error, see Validation |
JSON
{
"message": "There won't be any informative message here",
"errors": {
"any_key": [
"Here the error cause will be described"
]
}
}
|
Example |
JSON
curl -k --location --request PUT 'https://vms.local/api/v1/users/self' \
--header 'Authorization:Bearer token' \
--header 'Accept:application/json' \
--header 'X-Client:ios-cctv|android-cctv|thick-legal|web' \
--header 'X-UUID:unique device id' \
--header 'Content-Type: application/json \
--data-raw 'null'
|