V2.4 Search Product¶
Search for products based on the search criteria.
This API is only available if 2.4 Cumulative Update 1 has been applied to your environment.
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.4/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:
|
requireSecret |
Optional |
Boolean |
|
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. |
Error Codes¶
Code |
Message |
Description |
---|---|---|
99400 |
Invalid arguments |
One or multiple parameters are invalid. |
11858 |
Unable to find public key |
Unable to find public key for |
Samples¶
Request Sample¶
url: https://{apigw-address}/connect-service/v2.4/products?action=search&orgId=yourOrgId
method: POST
requestBody:
{
"expression":"modelId=\"AlterTest0615\"",
"pagination":{
"pageNo":1,
"pageSize":5
},
"requireSecret": true
}
Return Sample¶
{
"code":0,
"msg":"OK",
"requestId":"a82752bb-9eb0-4cd5-b0c6-0c1aeb35f6d2",
"data":[
{
"orgId":"yourOrgId",
"productKey":"yourProductKey",
"productName":{
"defaultValue":"openapi_sdk_8",
"i18nValue":{}
},
"productSecret"::"EncryptedProductSecret1",
"sessionKey":"EncryptedSessionKey1",
"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":"EncryptedProductSecret2",
"sessionKey":"EncryptedSessionKey2",
"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: