Last Updated on : 2024-06-20 07:19:50download
A third-party system server authorizes an account to access the Tuya Developer Platform and determines the type of the authorized account. It can be a user or staff account of the third-party system, or an account of any internal business form, such as an enterprise, store, or project.
Get a ticket. The third-party system server sends the authorized account and country code to the Tuya Developer Platform, and requests a ticket.
Get a session through the ticket.
lighting.console.tuyacn.com?ticket=xxxxx
. Typical case: Scan a QR code to control devices.Request method | API | Description |
---|---|---|
POST | /v1.0/industry/auth/admin | The third-party system authorizes an account to access the Tuya Developer Platform. |
POST | /v1.0/industry/auth/ticket | Get a ticket. |
POST | /v1.0/illumination/account/permission/add | Grant project space permissions to the account. |
GET | /v1.0/illumination/account/list | Get the list of authorized accounts. |
API description
Authorize enterprise staff to log in to the Tuya SaaS Platform.
API endpoint
POST /v1.0/industry/auth/admin
Request parameter
Parameter | Type | Parameter type | Description | Required |
---|---|---|---|---|
username | String | body | The account name. | Yes |
password | String | body | The password. | No |
nickName | String | body | The username. | No |
countryCode | String | body | The country code. Default value: 86 . |
No |
Response parameter
Parameter | Type | Description |
---|---|---|
Code | Integer | The response code. For more information, see the error code section. It is empty if the request is successful. |
success | Boolean | Indicates whether the operation is successful. Valid values:
|
msg | String | The error message that is returned if the request fails. It is empty if the request is successful. |
t | Long | The returned 13-digit timestamp. |
result | Object | The returned result. |
Description of result
"ay1575258560846OO4lC"
Sample request
{
"username": "123456",
"nickName": "xxxx",
"countryCode": "86"
}
Sample response
{
"success":"true",
"t":1541071460239,
"result":"ay1575258560846OO4lC"
}
API description
Get a ticket to log in to the Tuya SaaS Platform.
API endpoint
POST /v1.0/industry/auth/ticket
Request parameter
Parameter | Type | Parameter type | Description | Required |
---|---|---|---|---|
username | String | body | The username. | Yes |
countryCode | String | body | The country code. Default value: 86 . |
No. |
Response parameter
Parameter | Type | Description |
---|---|---|
Code | Integer | The response code. For more information, see the error code section. It is empty if the request is successful. |
success | Boolean | Indicates whether the operation is successful. Valid values:
|
msg | String | The error message that is returned if the request fails. It is empty if the request is successful. |
t | Long | The returned 13-digit timestamp. |
result | String | The returned result. |
Description of result
{
result:"12hjklgew2gtywgwxsdgw"
}
Sample request
{
"username": "186xxxx2790",
"countryCode":"86"
}
Sample response
{
"success":true,
"t":1541071460239,
"result": "12hjklgew2gtywgwxsdgw"
}
API description
Grant project space permissions to a sub-account.
API endpoint
POST /v1.0/illumination/account/permission/add
Request parameter
Parameter | Type | Parameter type | Description | Required |
---|---|---|---|---|
projectId | String | body | The project ID. | Yes |
tuyaUid | String | body | Tuya user ID. | Yes |
roomIdList | List | body | The list of space IDs. | Yes |
Response parameter
Parameter | Type | Description |
---|---|---|
Code | Integer | The response code. For more information, see the error code section. It is empty if the request is successful. |
success | Boolean | Indicates whether the operation is successful. Valid values:
|
msg | String | The error message that is returned if the request fails. It is empty if the request is successful. |
t | Long | The returned 13-digit timestamp. |
result | Object | The returned result. |
Description of result
{
true/false
}
Sample request
{
"tuyaUid": "ay1563*******1zJw30",
"projectId": "123324234",
"roomIdList": ["1420922162969059328"]
}
Sample response
{
"success":true,
"t":1541071460239,
"result": true
}
API description
Get the list of authorized accounts.
API endpoint
GET /v1.0/illumination/account/list
Request parameter
Parameter | Type | Parameter type | Description | Required |
---|---|---|---|---|
loginName | String | body | The login name. | No |
nickName | String | body | The nickname. | No |
page | int | body | The current page number. | No |
pageSize | int | body | The number of items returned per page. | No |
Response parameter
Parameter | Type | Description |
---|---|---|
Code | Integer | The response code. For more information, see the error code section. It is empty if the request is successful. |
success | Boolean | Indicates whether the operation is successful. Valid values:
|
msg | String | The error message that is returned if the request fails. It is empty if the request is successful. |
t | Long | The returned 13-digit timestamp. |
result | Object | The returned result. |
Description of result
{
"total": "int",
"list": [
{
"uid": "String // The UID",
"loginName": "String // The login name",
"nickName": "String // The nickname",
"roleCode": "String // The role code",
"roleName": "String // The role name",
"remark": "String // The remarks",
"createDate": "String // The creation date",
"adminId": "String // The account ID",
"page": "int",
"pageSize": "int"
}
]
}
Sample request
{
"loginName": "xxx",
}
Sample response
{
"total": "int",
"list": [
{
"uid": "xxxx",
"loginName": "",
"nickName": "",
"roleCode": "",
"roleName": "",
"remark": "",
"createDate": "",
"adminId": "",
}
]
}
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback