tencent cloud

ドキュメントTencent OneID Identity Security

Updating User Information

Download
フォーカスモード
フォントサイズ
最終更新日: 2026-08-26 15:38:13
AI翻訳

API Description

Update the personal information of a logged-in user. When calling this API, you must carry the Access Token obtained upon successful login, which must have the openid scope. If you update the phone number or email address, you must first call the Send OTP Verification Code API to send the verification code to the user.

Supported Application Types

Web applications, single-page applications, mobile apps, and M2M applications.

Request Method

PATCH

Request path

/userinfo

Request Content-Type

application/json

Request Example

PATCH /userinfo HTTP/1.1
Content-Type: application/json
Authorization: Bearer ACCESS_TOKEN_WITH_OPENID_SCOPE
Host: sample.portal.tencentciam.com

{
"nickname" : "MOCK_NICKNAME"
}

Request header

Term
Description
Authorization
The OAuth 2.0 Bearer Token has the format Bearer <Token>. Here, Bearer is a fixed string, and <Token> is the Access Token obtained upon successful user login, which contains the openid scope. A single space separates Bearer and <Token>.

Request Body JSON Parameters

JSON Path
Data Type
Description
phone_number
String
The user's mobile phone number must be an 11-digit number from one of the three major domestic carriers. When passing this parameter, you must also pass the two parameters phone_number_otp_token and phone_number_otp.
phone_number_otp_token
String
The otp_token returned by the server after the SMS verification code is sent successfully.
phone_number_otp
String
The OTP verification code received by the user's mobile phone.
email
String
The user's email address. When passing this parameter, you must also pass the two parameters email_otp_token and email_otp.
email_otp_token
String
The otp_token returned by the server after the email verification code is sent successfully.
email_otp
String
The OTP verification code received by the user's email.
name
String
User name.
nickname
String
User nickname.
zoneinfo
String
User time zone, such as Asia/Shanghai or Europe/Paris.
locale
String
User locale information, such as zh-CN or en-US.
Note:
The values of other parameters are user attribute identifiers. Attribute identifiers can be viewed on the attribute details page of the Attribute Customization page.

Normal Response Example

HTTP/1.1 200 OK
Content-Type: application/json

{
"sub" : "MOCK_USER_ID",
"email" : "MOCK_USERNAME@example.com",
"name" : "MOCK_NAME",
"nickname" : "MOCK_NICKNAME",
"zoneinfo" : "Asia/Shanghai",
"locale" : "zh-CN"
}
Note:
The sub field is always returned. Which other fields are returned is determined by the Claims in the application parameter configuration.

Exception Response Example

The input parameters contain unknown attributes.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "invalid_request",
"error_description" : "Unknown attribute(s) found."
}
The input parameters contain attributes that cannot be modified.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "invalid_request",
"error_description" : "Unsupported user attribute(s) found."
}
The phone number format is invalid.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "malformed_phone_number"
}
The phone number already exists.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "duplicate_phone_number"
}
The phone_number_otp_token is incorrect or has expired, or the parameters used during registration do not match those used when the verification code is sent (for example, the phone numbers are different).
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "bad_phone_number_otp_token"
}
The phone_number_otp is incorrect or has expired.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "bad_phone_number_otp"
}
The email address format is invalid.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "malformed_email"
}
The email address already exists.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "duplicate_email"
}
The email_otp_token is incorrect or has expired, or the parameters used during registration do not match those used when the verification code is sent (for example, the email addresses are different).
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "bad_email_otp_token"
}
The email_otp is incorrect or has expired.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "bad_email_otp"
}
The input parameter value is invalid (for example, it does not comply with the user attribute regular expression).
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "illegal_parameter_value"
}
The bearer_token is missing.
HTTP/1.1 400 Bad Request
WWW-Authenticate: Bearer error="invalid_request", error_description="Bearer token not found in the request", error_uri="https://tools.ietf.org/html/rfc6750#section-3.1"
The bearer_token is incorrect.
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer error="invalid_token", error_description="Error decoding JWT", error_uri="https://tools.ietf.org/html/rfc6750#section-3.1"
The bearer_token is invalid.
HTTP/1.1 403 Forbidden
WWW-Authenticate: Bearer error="insufficient_scope", error_description="The request requires higher privil


ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック