Last Updated on : 2024-03-18 07:45:28download
This API operation is used to sync a user account. When you need to bind your internal user account with Tuya's user platform, you can choose to synchronize your user account. When you synchronize your account for the first time, Tuya will create a user account based on your parameters and return the user ID of the Tuya platform. The next time you synchronize with the same parameters, a new user account will not be created, but the platform user ID created for the first time will be returned.
To suit your own business scenarios, you can create accounts and modify account information based on the sync parameters.
Note:
Once an account is created, you cannot modify the country code, username, and username type. Confirm the data when you create an account.
If you pass in the same username under the same application, the last password, nickname, or time zone ID of this user account will be updated according to the specific sync parameters.
POST: /v1.0/apps/{schema}/user
Parameter name | Type | IN | Required | Description |
---|---|---|---|---|
schema | String | uri | true | The schema of the specified app. |
Description of body
Parameter name | Type | IN | Required | Description |
---|---|---|---|---|
country_code | String | body | true | The country code. |
username | String | body | true | The username. |
password | String | body | true | The user's password. Use md5 hash to encrypt the user's original password as the parameter. |
username_type | Integer | body | true | The type of username. Valid values:
|
nick_name | String | body | false | The nickname. |
time_zone_id | String | body | false | The ID of the specified time zone. |
Parameter name | Type | Description |
---|---|---|
result | JSONObject | The returned result of synchronizing a user account. |
Description of result
Parameter name | Type | Description |
---|---|---|
uid | String | Tuya user ID. |
POST: /v1.0/apps/testApp/user
{
"country_code": "86",
"username": "182*****678",
"password": "c7fb2740c5f******4ed765a479fa",
"username_type": 1,
"time_zone_id": "Asia/Shanghai"
}
{
"result": {
"uid": "ay1534*****4744oIAa"
},
"success": true
}
For more information, see error code.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback