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

Request Parameters (URI)

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

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

Error Code

Type

Description

99400

  • Error info:message: (message content), detail message: (detailed message content)

  • device identifier is invalid

  • orgId is null

  • Parameter error. Detailed cause will be given in message or detailed message .

  • assetId or productKey + deviceKey is not included in the request to specify a device

  • orgId is not included in the request

11404

device can not be found

No device can be specified by assetId or productKey + deviceKey.

99500

  • hub service internal error!

  • certificate service err info:code: x, message: y, detail message: z

  • certificate service internal error!

  • Internal error

  • Internal CA service error. Detailed causes are given in message or detail message .

  • Internal certificate error