V2.1 Search Product¶
Search for products based on the search criteria.
This API is available in EnOS 2.1.0 and above. Version 2.4 has been added and it is recommended to use V2.4 Search Product.
If you need to invoke this API after performing bulk updates to relevant products using other APIs, it is recommended to wait for about 2 seconds to avoid obtaining unupdated data.
Request Format¶
POST https://{apigw-address}/connect-service/v2.1/products?action=search
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 |
---|---|---|---|
expression |
Optional |
String |
The query expression, which supports sql-like query. The fields that are supported for query include:
|
pagination |
Optional |
Pagination Request Struct |
Lists the paging requirements in a request. When not specified, 10 records are displayed per page by default and sorted in descending order by |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
Array of Product Structs |
A list of the products returned. For details of a Product Struct, see Product Struct. |
Samples¶
Request Sample¶
url: https://{apigw-address}/connect-service/v2.1/products?action=search&orgId=yourOrgId
method: POST
requestBody:
{
"expression":"modelId=\"AlterTest0615\"",
"pagination":{
"pageNo":1,
"pageSize":5
}
}
Return Sample¶
{
"code":0,
"msg":"OK",
"requestId":"a82752bb-9eb0-4cd5-b0c6-0c1aeb35f6d2",
"data":[
{
"orgId":"yourOrgId",
"productKey":"yourProductKey",
"productName":{
"defaultValue":"openapi_sdk_8",
"i18nValue":{}
},
"productSecret":"yourProductSecret",
"productDesc":"test_sdk_update",
"productType":"Device",
"dataFormat":"Custom",
"productTags":{},
"protocolGatewayIds":{},
"modelId":"AlterTest0615",
"dynamicActiveEnabled":false,
"biDirectionalAuth":true,
"createBy": null,
"createTime": null,
"updateBy": null,
"updateTime": 1589767858113
},
{
"orgId":"yourOrgId",
"productKey":"yourProductKey",
"productName":{
"defaultValue":"AlterTest0615_Product",
"i18nValue":{}
},
"productSecret":"yourProductSecret",
"productDesc":"",
"productType":"Device",
"dataFormat":"Json",
"productTags":{},
"protocolGatewayIds":{},
"modelId":"AlterTest0615",
"dynamicActiveEnabled":false,
"biDirectionalAuth":false,
"createBy": null,
"createTime": null,
"updateBy": null,
"updateTime": 1589767858113,
"defaultValidDay":null,
"maxValidDay":null
}
],
"pagination":{
"sortedBy":null,
"pageNo":1,
"pageSize":5,
"totalSize":2
}
}
SDK Samples¶
You can access the SDK samples for Connection Service on GitHub: