Last Updated on : 2025-05-30 01:56:03download
Request method | API | description |
---|---|---|
POST | /v1.0/osaas/contractor/authorization | API for Authorizing a Constructor. |
GET | /v1.0/osaas/contractor/authorizations | API for Querying the Constructor Authorization List. |
DELETE | /v1.0/osaas/contractor/authorizations/{authorization_id} | URL for Unauthorizing a Constructor. |
GET | /v1.0/osaas/contractors | API for Obtaining the Constructor List. |
You can use this API to authorize the main account of a constructor that has been registered with and passed the enterprise authentication on the construction platform.
POST /v1.0/osaas/contractor/authorization
Parameter | Type | Position | Description | Mandatory |
---|---|---|---|---|
country_code | String | BODY | Country code. 86: China | Yes |
username | String | BODY | Main account of a constructor, which is a mobile number or an email address. | Yes |
Parameter | Type | Description |
---|---|---|
code | Integer | Response code.Null indicates success. |
success | Boolean | Request result. true: success false: failure |
msg | String | Exception message.It is null when the request result is success. |
t | Long | Response time, which is a 13-digit timestamp. |
result | String | Unique ID of an authorization. |
POST /v1.0/osaas/contractor/authorization
{
"countryCode": "86",
"username": "test@tuya.com"
}
{
"success": true,
"t": 1566053034624,
"result": "116082396505314xxxxx"
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
You can use this API to query the list of authorized constructors.
GET /v1.0/osaas/contractor/authorizations
Parameter | Type | Position | Description | Mandatory |
---|---|---|---|---|
page_no | Integer | URL | Page number. The default value is 1. | No |
page_size | Integer | URL | Number of records on a page, which is greater than 0 and less than 100. If this parameter is not set, the number is 20 by default. | No |
Parameter | Type | Description |
---|---|---|
code | Integer | Response code.Null indicates success. |
success | Boolean | Request result. true: success false: failure |
msg | String | Exception message.It is null when the request result is success. |
t | Long | Response time, which is a 13-digit timestamp. |
result | Object | Result object. |
Parameters in result
Parameter | Type | Description |
---|---|---|
total | Integer | Total number of records. |
page_no | Integer | Page number. |
page_size | Integer | Number of records on a page. |
authorizations | Arrays | Set of authorized constructors. |
Parameters in authorizations
Parameter | Type | Description |
---|---|---|
authorization_id | String | Unique ID of an authorization. |
username | String | Main account of a constructor. |
enterprise_name | String | Enterprise name of a constructor. |
cooperation_time | Long | Cooperation time, which is a 13-digit timestamp. The default value is 0. A value is assigned after the constructor confirms the authorization. |
GET {url}/v1.0/osaas/contractor/authorizations?page_no=1&page_size=10
{
"result": {
"total": 1,
"page_no": 1,
"page_size": 10,
"authorizations":[
{
"authorization_id": "1160823965053******",
"username": "test@tuya.com",
"enterprise_name": "Enterprise name of a constructor",
"cooperation_time": 1559707046000
}
]
},
"success": true,
"t": 1561381210234
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
You can use this API to unauthorize a constructor.
DELETE /v1.0/osaas/contractor/authorizations/{authorization_id}
Parameter | Type | Position | Description | Mandatory |
---|---|---|---|---|
authorization_id | String | URI | Unique ID of an authorization. | Yes |
Parameter | Type | Description |
---|---|---|
code | Integer | Response code.Null indicates success. |
success | Boolean | Request result. true: success false: failure |
msg | String | Exception message.It is null when the request result is success. |
t | Long | Response time, which is a 13-digit timestamp. |
result | Boolean | Operation result. |
DELETE {url}/v1.0/osaas/contractor/authorizations/{authorization_id}
{
"success": true,
"result": true,
"t": 1566053034624
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
You can use this API to obtain the list of authorized constructors.
GET /v1.0/osaas/contractors
Parameter | Type | Description |
---|---|---|
code | Integer | Response code.Null indicates success. |
success | Boolean | Request result. true: success false: failure |
msg | String | Exception message.It is null when the request result is success. |
t | Long | Response time, which is a 13-digit timestamp. |
result | Arrays | Set of authorized constructors. |
Parameters in result
Parameter | Type | Description |
---|---|---|
contractor_uid | String | Unique ID of a constructor. |
contractor_name | String | Constructor name. |
{
"result": [
{
"contractor_uid": "bayxxxxxxxxxxxxxfcDz",
"contractor_name": "XXX 服务商"
}
],
"success": true,
"t": 1561381210234
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
The following are common business exceptions for this interface. For more exception errors, see Global Error Codes.
error code | explain |
---|---|
500 | system error |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback