Create Product¶
Create a product.
Operation Permissions¶
| Required Authorization | Required Operation Permission | 
|---|---|
| Device Management | Full Access | 
Request Format¶
POST https://{apigw-address}/connect-service/v2.1/products?action=create
Request Parameters (URI)¶
| Name | Location (Path/Query) | Mandatory/Optional | Data Type | Description | 
|---|---|---|---|---|
| orgId | Query | Mandatory | String | The organization ID which the asset belongs to. How to get orgId>> | 
Request Parameters (Body)¶
| Name | Mandatory/Optional | Data Type | Description | 
|---|---|---|---|
| productDesc | Optional | String | The product description. | 
| biDirectionalAuth | Mandatory | Boolean | 
 | 
| modelId | Mandatory | String | The model ID which the asset belongs to. How to get modelID>> | 
| dataFormat | Mandatory | String | Supports only two values:  
 | 
| productName | Mandatory | StringI18n | The product name. For more details on the structure and locales supported, see Internationalized name struct. | 
| productType | Mandatory | String | Supports only two values:  
 | 
| dynamicActivateEnabled | Optional | Boolean | 
 | 
| productTags | Optional | Map | The tags of the product. For details, see How to use tags. | 
| defaultValidDay | Optional | Integer | Only applicable when  | 
| maxValidDay | Optional | Integer | Only applicable when  | 
Response Parameters¶
| Name | Data Type | Description | 
|---|---|---|
| data | String | The key of the created product. | 
Error Codes¶
| Code | Message | Description | 
|---|---|---|
| 99500 | Query model failed | The  | 
Samples¶
Request Sample¶
url: https://{apigw-address}/connect-service/v2.1/products?action=create&orgId=yourOrgId
method: POST
requestBody:
{
    "productDesc":"openapi_sdk_create_test",
    "biDirectionalAuth":false,
    "modelId":"AlterTest0615",
    "dataFormat":"Custom",
    "productName":{
        "defaultValue":"AlterTest0615_Product",
        "i18nValue":{}
    },
    "productType":"Device",
    "dynamicActivateEnabled":false,
    "productTags": {
        "key1": "v1"
    }
}
Return Sample¶
{
    "code":0,
    "msg":"OK",
    "requestId":"522d0269-445d-4f13-be04-1424e0e2893e",
    "data":"2zp6A70r"
}