Create Webhook Subscription

Create Webhook Subscription

This API enables user to create a webhook subscription for receiving notifications.

Request
URI
POST
https://{api_host}/tcsa/api/webhooks/v1/subscriptions
COPY
Request Body

Request to create webhook subscription.

SubscriptionRequest of type(s) application/json
Required

Show optional properties

{
    "name": "router-wh",
    "description": "webhook to get router events",
    "url": "https://play/in/e_y1sI1Dy8IvkYQcgYQy5yoHAtR7E/",
    "vsafilter": {
        "filterlist": [
            {
                "condition": "OR",
                "propfilter": [
                    {
                        "propname": "ClassName",
                        "matchtype": "EQ",
                        "values": [
                            "Router"
                        ]
                    }
                ]
            }
        ]
    }
}
{
    "name": "string",
    "description": "string",
    "url": "string",
    "headers": {
        "headers": "string"
    },
    "vsafilter": {
        "condition": "AND",
        "filterlist": [
            "Filter Object"
        ]
    },
    "disabled": false
}
string As ^[a-zA-Z0-9_-]+$
name
Required
Constraints: minLength: 1

unique name for subscription

string
description
Required

Description about the webhook

string As ^(https?)://[^\s/$.?#].[^\s]*$
url
Required
Constraints: minLength: 1

A publicly accessible URL where user wants to receive notifications

object
headers
Optional

Additional headers users wants to receive along with notification

object
vsafilter
Required

The VSAFilter object defines how the filters has to be applied on queries.

boolean
disabled
Optional

Defines subscriptions is active or inactive.

Authentication
This operation uses the following authentication methods.
Responses
201

Created

Returns SubscriptionModel of type(s) application/json
"SubscriptionModel Object"
string
id
Optional

Unique subscrpiton id .

string
name
Optional

Name of the subscription.

string
app_id
Optional

Id of the internal application .

boolean
disabled
Optional

Subscription is active or inactive

integer
start_time
Optional

Subscription start time.

integer
update_time
Optional

Subscription update time.

string
user_name
Optional

User who had created the subscription.

string
type
Optional

The type of subscription.

string
description
Optional

Detail description about the subscription.

string
url
Optional

The URL set to receive notifications.

object
headers
Optional

Headers set for subscription.

object
vsafilter
Optional

The VSAFilter object defines how the filters has to be applied on queries.


400

Bad request

Operation doesn't return any data structure

409

Conflict

Operation doesn't return any data structure

Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"name:"string","description:"string","url:"string","vsafilter:"object"}' https://{api_host}/tcsa/api/webhooks/v1/subscriptions