List Certificate¶
List all certificates bound to the device.
Operation Permissions¶
Required Authorization |
Required Operation Permission |
---|---|
Device Management |
Read Access |
Request Format¶
GET http://{apigw-address}/connect-service/v2.0/certificates?action=list
Request Parameters (URI)¶
Note
One of the following options must be used in a request to specify a device
assetId
productKey
+deviceKey
Name |
Location (Path/Query) |
Required or Not |
Data Type |
Description |
---|---|---|---|---|
orgId |
Query |
True |
String |
Organization ID which the asset belongs to. How to get Organization ID>> |
assetId |
Query |
false |
String |
Asset ID of the device |
productKey |
Query |
false |
String |
Product key of the device |
deviceKey |
Query |
false |
String |
Device key of the device |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
DeviceCertDetailInfo object |
Certificate information. See the table below for its structure. |
DeviceCertDetailInfo Object¶
Sample¶
Java SDK Sample¶
package com.envisioniot.enos.api.sample.connect_service.cert;
import com.envision.apim.poseidon.config.PConfig;
import com.envision.apim.poseidon.core.Poseidon;
import com.envisioniot.enos.connect_service.v2_1.cert.ListCertificatesRequest;
import com.envisioniot.enos.connect_service.v2_1.cert.ListCertificatesResponse;
import com.envisioniot.enos.connect_service.vo.CertificateInfo;
import com.envisioniot.enos.connect_service.vo.DeviceIdentifier;
import java.util.List;
public class ListCert {
public static void main(String[] args) {
ListCertificatesRequest listCertificatesRequest = new ListCertificatesRequest();
String appKey = "e36cc693-3a07-456e6cafcbc2-9314-4ff6";
String appSecret = "6cafcbc2-9314-4ff6-9450-861d4344a431";
String serverUrl = "http://apim-apigw-proxy.alpha-k8s-cn4.eniot.io";
String orgId = "o15444172373271";
DeviceIdentifier device = new DeviceIdentifier();
// Either assetId or productKey + deviceKey is required.
device.setProductKey("ymcDiAHd");
device.setAssetId("KloXinjW");
device.setDeviceKey("TT6MyEFaO7");
listCertificatesRequest.setDevice(device);
listCertificatesRequest.setOrgId(orgId);
ListCertificatesResponse certRsp = Poseidon.config(PConfig.init().appKey(appKey).appSecret(appSecret).debug())
.url(serverUrl)
.getResponse(listCertificatesRequest, ListCertificatesResponse.class);
List<CertificateInfo> certificateInfos = certRsp.getData();
if (certificateInfos != null) {
for (CertificateInfo certificateInfo : certificateInfos) {
System.out.println(certificateInfo);
}
}
}
}
Error Code¶
Error Code |
Type |
Description |
---|---|---|
99400 |
|
|
11404 |
device can not be found |
No device can be specified by |
99500 |
|
|