Update a Webhook

This API allows you to update an existing webhook.

It is mandatory to pass the Webhook Id of the webhook you wish to update.

API URL

POST
https://(host)/v2/Webhook.svc/Update?accessKey=AccessKey&secretKey=SecretKey
Copy URL

Request

JSON Body/Payload

Content-Type: application/json

{
"WebhookId": "b1c420d7-9c3e-11e7-b0ab-02e89b2fb8f4",  
"Description": "Updated description",
  "URL": "https://www.example.com",
  "Method": "POST",
  "ContentType": "application/json",
  "WebhookEvent": "1",
  "LandingPageUrls": null,
  "IsSpecificLandingPage": false,
  "NotifyOnFailure": true,
  "WebhookProperties": null
}

JSON Properties

Parameter Description
WebhookId

Identifier that uniquely identifies the webhook in LeadSquared. It is mandatory to pass this parameter while updating a webhook.

Description

You can add any text here to describe the webhook.

URL

Specify the URL you want the data posted to. You may use a HTTP or a HTTPS URL. In most cases HTTP is sufficient, but HTTPS can be useful if your data is sensitive.

Method

The HTTP method, which will always be POST in this case.

ContentType

The format you want the data to be posted in. Supported formats are:

  • application/json
  • application/x-www-form-urlencoded
  • text/plain
WebhookEvent

A number that represents the event on which the webhook will trigger:

1 – landing_page_submission

2 – LeadActivity_Post_Create

3 – Lead_Post_Create

4 – Lead_Owner_Change

5 – Lead_Post_Stage_Change

6 – Lead_Post_Update

7 – task_create

8 – task_reminder

9 – Score Change

LandingPageUrls

Specifies the landing page(s) on which the event will occur if the event pertains to landing page submission.

IsSpecificLandingPage

This value should be ‘true’ if the list of landing page URLs is provided.

NotifyOnFailure

Entering ‘true’ will ensure that you are notified whenever a webhook fails.

WebhookProperties

If the webhook pertains to a lead activity, pass the activity details as shown below:

{“ActivityEvent”:”247″,
“ActivityData”:”[]”,
“WebPageNames”:”[]”}

Response

200 OK

Content-Type: application/json

{
    "Status": "Success"
}

HTTP Response Code

Code Description
200 OK

This is the status code for successful API call.

401 Unauthorized

The API call was made with invalid access credentials. Check your AccessKey and SecretKey.

400 Bad Request

The message body on the request is not as per API specification. Make sure that content type is set to “application/json” and the JSON body has correct attribute names and structure.

404 Not Found

The API could not be found. Please check the API signature.

429 Too Many Requests

API calls exceeded the limit of 25 in 5 second(s)

500 Internal Server Error

The API called failed. There could be many reasons for it. Check the exception message to get more details.