Update a User
API Overview
This API modifies a user nickname.
API URL
POST Http://{anymetrics_host:anymetrics_port}/anymetrics/api/v1/user/edit
For how to obtain anymetrics_host:anymetrics_port, see Calling APIs
Request Parameters
Common Request Parameters (HEADERS)
| Parameter | Type | Required | Description |
|---|---|---|---|
| tenant-id | String | Yes | Tenant ID,used to identify the tenant that contains the metric query content |
| auth-type | String | Yes | Authentication method. Supports UID、TOKEN、ACCOUNT、APIKEY |
| auth-value | String | Yes | Authentication value corresponding to auth-type |
Request Parameters
| Parameter | Type | Required | Max Length | Description | Example Value |
|---|---|---|---|---|---|
| nickName | String | Yes | 32 | New user nickname | account123 |
| userId | String | Yes | ID of the user to modify | 463663891121963008 |
Response Parameters
| Parameter | Type | Required | Max Length | Description | Example Value |
|---|---|---|---|---|---|
| code | String | Yes | 32 | API response code | 200 |
| succeess | boolean | Yes | Whether successful | true | |
| errorMsg | String | Yes | 512 | Error message | NULL |
| detailErrorMsg | String | Yes | 512 | Error details returned when the request fails | NULL |
| traceId | String | Yes | 128 | traceId | fdde343f9ff2dcd70.292.16857691758642861 |
| data | String | Yes | 32 | Returned userId | 478209624953061376 |
Request Example
curl --location --request POST 'https://127.0.0.1:8083/anymetrics/api/v1/user/edit' \
--header 'auth-type: UID' \
--header 'tenant-id: tn_19487697' \
--header 'auth-value: 463663891121963008' \
--header 'Accept-Language: zh-CN' \
--data-raw '{
"nickName":"CAN_A",
"userId":"463707832823316480"
}'