Revoke a Certificate in Sync mode

The API will submit a request to revoke an existing certificate in Sync Mode. There are two parameters that are different than async APIs. They are "isSync" and "ttl". If "isSync", that is, Sync Mode is true, it overrides the policy for certificate request approvals to Revoke the Certificate. You can use these two parameters for all the CA's mentioned in the async APIs.

Request Structure

API: /certificate/revoke

Method: PUT

URL: https://<APPVIEWX_GATEWAY_IP>:<APPVIEWX_GATEWAY_PORT>/avxapi/certificate/revoke?gwkey=f000ca01&gwsource=external&isSync=true&ttl=300

Table 1. Parameters

Name

Type

Mandatory

Field Type

Description

Constraints

userName

Header

Yes

String

Username that is configured in AppViewX.

password

Header

Yes

String

Password of that user.

content-type

Header

Yes

String

Payload content-type with application/json value.

The value must be application/json.

gwkey

Queryparam

Yes

String

Tenant Key. This is needed only in case of multi tenant installations and can be ignored in other type of installations.

gwsource

Queryparam

Yes

String

Source, from which the request is triggered. For example, external.

isSync

Queryparam

No

boolean

The possible values are true and false. If you want to use sync API, set the value as true. If you want to use the async API, set the value as false.

Note: Default value is false.

Must be a valid boolean value: true or false.

ttl

Queryparam

No

Int

Time to live for a response in seconds. Default value is 300 seconds. Must be a positive integer.

Body

Body

Yes

json

Refer to the sample request body.

Table 2. SyncRevokeRequest
Name

Mandatory

Description

Field Type

Constraints

resourceId

Yes

Mongo Id of the certificate in the AppViewX database.

Note: It refers to the ‘resourceId’ field in the create certificate response. It can be found using the search API using commonName, serial No. or other search parameters.

String

Either resourceId or serialNumber and commonName is mandatory.

commonName

Yes

Common name of the certificate.

String

serialNumber Yes Serial number of the certificate. String
reason Yes Reason for revoke. String
comments Yes Comments for Revocation String Comments field is mandatory for some revoke reasons alone. Refer Valid Reason for CAs table.
Table 3. Valid Reason for CAs

Certificate Authority

Reasons

Comments Required

Entrust

Superseded

No

Cessation of operation

No

Affiliation Changed

No

Key compromised

Yes

Sync Revoke Response Structure

Response returns string of type application/json with the following body params:

Table 4. Parameters
Name Description Field Type
response Contains the response attributes for the enrollment request. RevokeResponseStructure (explained in the following table)
message Success message or failure description in case of error. String
appStatusCode Application specific status code for the response. Will be non-null for failure response. String
tags More info in case of failure response. NA
Table 5. RevokeResponseStructure
Name Description Field Type
resourceId Identifier of the certificate record that has been created. String
requestId Open work order request ID. String
certStatus Status of the certificate action request. String

Sample Request/Response

Sample Request
 {
 "resourceId": "5fa27b7ffee3a70235a5816d",
 "reason" :"Superseded"
 } 
Sample Response
 { 
 "response": {
 "resourceId": "<Certificate ID>",
 "requestId": "<Certificate WF Request ID>",
 "certStatus": "Revoked"
 },
 "message": "Certificate Revoke action executed successfully",
 "appStatusCode": "<Error Code>",
 "tags": {},
 "headers": null
 }