Create Slack Action

You can create an alert to be notified through Slack. Specify the necessary details in the request body that are required for Slack such as action name, action description, the recipient details, whom the alert should be sent to and so on.

POST  /rest/v1/actions/slack

Input ParametersInput Parameters

Parameter

Mandatory/Optional Data Type

Description

slackRequest  

Mandatory Body

Specify the action actionName, actionDescription, and recipients and so on. Refer to the following example for exact syntax.

{

  "actionDescription": "string",

  "actionName": "string",

  "channel": "string",

  "webhookUri": "string"

}

Where,

actionDescription: description that tells the purpose of the action

actionName: name of the action

channel: the channel name of your slack account

webhookUri: the Webhook URI required to connect to your slack account to post alert messages.

Sample - Create Slack ActionSample - Create Slack Action

API request

    
      curl -k -X POST -u <username>:<password>
      'https://<QualysBaseURL>/cloudview-api/rest/v1/actions/slack'
      

Request POST Data

    
      {
    "actionDescription": "Sample slack action description",
    "actionName": "Sample slack action",
    "channel": "Sample-slack""webhookUri": "https://hooks.slack.com/services/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"
}
      

Response

    
      {
    "success": "bd786210-9965-11e8-ab43-6187ace8f6e8"
}