V2.0 Revoke Certificate¶
Revoke the certificate bound to a device.
This API is available in EnOS 2.1.0 and above.
Operation Permissions¶
Before invoking this API, ensure that the service account has been authorized the policy that includes the following service(s) and action permission(s). For how to authorize the service account, see Managing Service Accounts.
Required Service | Required Operation Permission |
---|---|
Certificate | Revoke |
Prerequisites¶
- The device exists and is registered on EnOS.
- The certificate is bound to the device.
- The certificate is within its validity period.
Request Format¶
POST https://{apigw-address}/connect-service/v2.0/certificates?action=revoke
Request Parameters (URI)¶
Note
Use one of the following methods to specify the device:
- Include
assetId
in the request - Include
productKey
+deviceKey
in the request
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>> |
assetId | Query | Optional (See Note above) | String | The asset ID. How to get assetId>> |
productKey | Query | Optional (See Note above) | String | The product key. To be used with deviceKey . |
deviceKey | Query | Optional (See Note above) | String | The device key. To be used with productKey . |
Request Parameter (Body)¶
Name | Mandatory/Optional | Data Type | Description |
---|---|---|---|
certSn | Mandatory | Integer | The number of the certificate to be revoked. This number is the certSN number returned when applying for a certificate. It can also be retrieved by using the List Certificate API. |
reason | Optional | Integer |
|
Error Codes¶
Code | Type | Solution |
---|---|---|
99400 | invalid argument: The device identifier is invalid | Specify (assetId ) or (productKey + deviceKey ) in your request. |
99400 | Invalid Argument certSn:certSn is missing | Include a valid certSn in your request. |
99400 | Call ca error!: Certificate service err info:, code: (code), message: (message content), detail message: (detailed message content) | Refer to the “message” and “detailed message”. |
99400 | Invalid cert request!message: (message content), detail message: (detailed message content) | Refer to the “message” and “detailed message”. |
99400 | Query cert is failed!message: (message content), detail message: (detailed message content) | Refer to the “message” and “detailed message”. |
99400 | When calling Certificate Services, the call parameters are invalid.message: (message content), detail message: (detailed message content) | Refer to the “message” and “detailed message”. |
99400 | The serial number of the certificate to be updated is required. | Include certSn in your request. |
99400 | The serial number of the new certificate is invalid (less than 0). | Ensure certSn is valid. |
99400 | The certificate list bound to the device does not have the certificate, or the certificate is bound to other devices. | Ensure the certificate specified in the request is valid. |
11404 | Device cannot be found | Ensure that the device exists and is registerd on EnOS. |
99500 | Internal error of certificate service. | Refer to your EnOS administrator. |
99500 | Internal error of product service. | Refer to your EnOS administrator. |
99500 | Internal error of IoT Hub service. | Refer to your EnOS administrator. |
Samples¶
Request Sample¶
url: https://{apigw-address}/connect-service/v2.0/certificates?action=revoke&assetId=yourDeviceAssetId&orgId=yourOrgId
method: POST
requestBody:
{
"reason":0,
"certSn":52739
}
Response Sample¶
{
"code":0,
"msg":"OK",
"requestId":"e3391ff8-19ba-4809-b944-c1b29f468af9",
"data":null
}