Delete Product¶
删除产品。
操作权限¶
需授权的资源 |
所需操作权限 |
---|---|
设备管理 |
Full Access |
请求格式¶
POST https://{apigw-address}/connect-service/v2.1/products?action=delete
请求参数(URI)¶
名称 |
位置(Path/Query) |
必需/可选 |
数据类型 |
描述 |
---|---|---|---|---|
orgId |
Query |
必需 |
String |
资产所属的组织 ID。 如何获取 orgId 信息>> |
productKey |
Query |
必需 |
String |
产品的 Product Key。 |
响应参数¶
名称 |
数据类型 |
描述 |
---|---|---|
data |
String |
删除的产品的 product key。 |
错误码¶
代码 |
错误信息 |
描述 |
---|---|---|
11404 |
Product cannot be found |
|
11619 |
Existing Device Restrictions |
删除的产品下存在设备。 |
示例¶
请求示例¶
url: https://{apigw-address}/connect-service/v2.1/products?action=delete&orgId=yourOrgId&productKey=yourProductKey
method: POST
返回示例¶
{
"code":0,
"msg":"OK",
"requestId":"ef6a7fbb-0834-45fb-b1d4-6bd2dc25796f",
"data":"atC41UIe"
}
Java SDK 调用示例¶
package com.envisioniot.enos.api.sample.connect_service.product;
import com.envision.apim.poseidon.config.PConfig;
import com.envision.apim.poseidon.core.Poseidon;
import com.envisioniot.enos.connect_service.v2_1.product.DeleteProductRequest;
import com.envisioniot.enos.connect_service.v2_1.product.DeleteProductResponse;
public class DeleteProduct {
public static void main(String[] args) {
String appKey = "yourAppKey";
String appSecret = "yourAppSecret";
String serverUrl = "yourSeverUrl";
String orgId = "yourOrgId";
DeleteProductRequest request = new DeleteProductRequest();
request.setOrgId(orgId);
request.setProductKey("yourProductKey");
DeleteProductResponse response = Poseidon.config(PConfig.init().appKey(appKey).appSecret(appSecret).debug())
.url(serverUrl)
.getResponse(request, DeleteProductResponse.class);
}
}