Deactivate a webhook
1 min
POST
https://api.campaign.episerver.net/rest/{clientId}/webhooks/{webhookId}/deactivate
Path Parameters
- clientIdinteger<int64>requiredDescriptionFormatint64
- webhookIdinteger<int64>requiredDescriptionFormatint64
Header Parameters
- acceptstringDescriptionDefaultapplication/jsonAllowedapplication/jsonapplication/vnd.optivo.broadmail.v1+json
Responses
200
- RestWebhook
- idinteger<int64>DescriptionFormatint64
- typestring<open | click | sent | bounce | unsubscribe | spamcomplaint | webhooknode | singleoptin | confirmedoptin | doubleoptin | blocklist | archived | filteredbyblocklist>DescriptionAllowedopenclicksentbounceunsubscribespamcomplaintwebhooknodesingleoptinconfirmedoptindoubleoptinblocklistarchivedfilteredbyblocklist
- statusstring<created | activated | deactivated | deleted | suspended>DescriptionAllowedcreatedactivateddeactivateddeletedsuspended
- formatstring<json>DescriptionAllowedjson
- targetUrlstringDescription
- authenticationWebhookAuthenticationDescription
- typestringrequired
- createdstring<date-time>DescriptionFormatdate-time
- modifiedstring<date-time>DescriptionFormatdate-time
400
404
409
curl
curl --request POST \
--url https://api.campaign.episerver.net/rest/{clientId}/webhooks/{webhookId}/deactivate \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'POST',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.campaign.episerver.net/rest/{clientId}/webhooks/{webhookId}/deactivate", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.campaign.episerver.net/rest/{clientId}/webhooks/{webhookId}/deactivate")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.campaign.episerver.net/rest/{clientId}/webhooks/{webhookId}/deactivate"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// The webhook was deactivated successfully.
{
"id": "",
"type": "",
"status": "",
"format": "",
"targetUrl": "",
"authentication": {
"type": ""
},
"created": "",
"modified": ""
}400
// The webhook is not in status "activated".
404
// The webhook could not be found. Ensure that the required parameters such as "webhookId" are correct and the webhook exists.
409
// The webhook ID is not assigned to the current client.