PUT Alerts Pending

The PUT /Alerts/Pending operation updates a pending certificate request alert. On success, the operation returns HTTP 200 OK with  details about the pending certificate request alert.

Tip:  The following permissions (see Security Roles and Claims) are required to use this feature:

/monitoring/alerts/modify/

Important:  This operation replaces the entire record. Any fields not included in the request are cleared or set to their default values.

To avoid unintended data loss, first perform a GET to retrieve the existing record, update only the required fields, and then submit the full set of values in the PUT request.

Table 239: PUT Alerts Pending Input Parameters

Name

In

Description

id Path An integer indicating the Keyfactor Command reference ID of the pending request alert.
DisplayName Body Required. A string indicating the display name for the pending request alert. This name appears in the pending request alerts grid in the Management Portal.
Subject Body

Required. A string indicating the subject for the email message that will be delivered when the alert is triggered.

Tip:  Substitutable special text may be used in the subject line. Substitutable special text uses a variable in the alert definition that is replaced by data from the certificate request or certificate metadata at processing time. For example, you can enter {rcn} in the alert definition and each alert generated at processing time will contain the specific requested common name of the given certificate request instead of the variable {rcn}.
Message Body

Required. A string indicating the email message that will be delivered when the alert is triggered. The email message is made up of regular text and substitutable special text. If desired, you can format the message body using HTML.

For example:

Copy
"<p>Hello,</p> \n\n<p>A certificate using the {template} template was requested by {requester} from {careqid} on {subdate}. The certificate details include:</p> \n\n<table> \n<tr><th>Certificate Details </th><th>Metadata </th></tr> \n<tr><td>CN: {rcn}</td><td>App Owner First Name: {metadata:AppOwnerFirstName}</td></tr> \n<tr><td>DN: {rdn}</td><td>App Owner Last Name: {metadata:AppOwnerLastName}</td></tr> \n<tr><td>SANs: {san}</td><td>App Owner Email Address: {metadata:AppOwnerEmailAddress}</td></tr> \n<tr><td>&nbsp;</td><td>Business Critical: {metadata:BusinessCritical}</td></tr> \n</table> \n\n<p>Please review this request and issue the certificate as appropriate by going here:</p> \n\n<p>{apprlink}</p> \n\n<p>Thanks!</p> \n\n<p>Your Certificate Management Tool</p>"

See Substitutable Special Text for Pending Request Alerts for a complete list of available substitutable special text strings.

Note:  When using HTML to format an email sent from Keyfactor Command, use inline styles and avoid linked stylesheets or embedded <style> rules. Many email clients do not fully support external or embedded CSS.

Line breaks are not inserted automatically when HTML formatting is used. Define line breaks explicitly using tags such as <br>, <br/>, or <p></p>.

Recommended:

<p style="font-size:14px; color:#333; margin:0 0 12px;">Hello</p>

Not Recommended:

<link rel="stylesheet" href="https://cdn.keyexample.com/styles.css">

or

<style>p { color:#333; }</style>
Recipients Body

An array of strings containing the recipients for the alert. Each alert can have multiple recipients. You can use specific email addresses and/or use substitutable special text to replace an email address variable with actual email addresses at processing time.

When entering email addresses on the Recipients parameter, if more than one recipient is added to a string, all recipients in that string receive the same email and can see the other recipients on the email. To do this, enter email addresses separated by commas or semi-colons withing the string. To include multiple strings, separate each string by a comma within the array.

"Recipients": [
 "admin@keyexample.com", 
 "pkiadmins@keyexample.com,bbrown@keyexample.com"
]
TemplateId Body

An integer indicating the certificate template for which the pending request alerts will be generated. A separate alert should be configured for each template. An alert may be configured with no template, if desired. Alerts configured in this way generate alerts for all pending certificate requests.

Use the GET Templates operation to retrieve a list of all the templates to determine the template ID.

RegisteredEventHandler Body

An object containing the event handler configuration for the alert, if applicable. ClosedShow event handler details.

For more information about event handlers, see Using Event Handlers.

EventHandlerParameters Body

An array of objects containing the parameters configured for use by the event handler. The type of data will vary depending on the configured handler. ClosedShow event handler parameter details.

For example, for a PowerShell handler:

Copy
"EventHandlerParameters": [
   {
      "Id": 28,
      "Key": "cn",
      "DefaultValue": "rcn",
      "ParameterType": "Token"
   },
   {
      "Id": 29,
      "Key": "AppOwnerFirstName",
      "DefaultValue": "metadata:AppOwnerFirstName",
      "ParameterType": "Token"
   },
   {
      "Id": 30,
      "Key": "Text",
      "DefaultValue": "Pending Alert: Enterprise Web Server",
      "ParameterType": "Value"
   },
   {
      "Id": 31,
      "Key": "ApprovalLink",
      "DefaultValue": "apprlink",
      "ParameterType": "Token"
   },
   {
      "Id": 32,
      "Key": "ScriptName",
      "DefaultValue": "MyScript.ps1",
      "ParameterType": "Script"
   }
]

Table 240: PUT Alerts Pending Response Data

Name

Description

Id

An integer indicating the Keyfactor Command reference ID of the pending request alert.

DisplayName A string indicating the display name for the pending request alert. This name appears in the pending request alerts grid in the Management Portal.
Subject

A string indicating the subject for the email message that will be delivered when the alert is triggered.

Tip:  Substitutable special text may be used in the subject line. Substitutable special text uses a variable in the alert definition that is replaced by data from the certificate request or certificate metadata at processing time. For example, you can enter {rcn} in the alert definition and each alert generated at processing time will contain the specific requested common name of the given certificate request instead of the variable {rcn}.
Message

A string indicating the email message that will be delivered when the alert is triggered. The email message is made up of regular text and substitutable special text. If desired, you can format the message body using HTML.

See Substitutable Special Text for Pending Request Alerts for a complete list of available substitutable special text strings.

Recipients

An array of strings containing the recipients for the alert. Each alert can have multiple recipients. You can use specific email addresses and/or use substitutable special text to replace an email address variable with actual email addresses at processing time.

When entering email addresses on the Recipients parameter, if more than one recipient is added to a string, all recipients in that string receive the same email and can see the other recipients on the email. To do this, enter email addresses separated by commas or semi-colons withing the string. To include multiple strings, separate each string by a comma within the array.

"Recipients": [
 "admin@keyexample.com", 
 "pkiadmins@keyexample.com,bbrown@keyexample.com"
]
Template

An object containing information about the certificate template for which the pending request alerts will be generated. A separate alert should be configured for each template. An alert may be configured with no template, if desired. Alerts configured in this way generate alerts for all pending certificate requests. ClosedShow template details.

RegisteredEventHandler

An object containing the event handler configuration for the alert, if applicable. ClosedShow event handler details.

For more information about event handlers, see Using Event Handlers.

EventHandlerParameters

An array of objects containing the parameters configured for use by the event handler. The type of data will vary depending on the configured handler. ClosedShow event handler parameter details.