Delete Webhook
Deleting a webhook allows you to remove a previously configured webhook from your system. This process ensures that you will no longer receive notifications or updates associated with that webhook. To delete a webhook, you'll need to send a DELETE request to the specified endpoint. The request should include the unique id of the webhook you wish to remove.
Endpoint: https://api.amlwatcher.com/api/webhook/:webhook_id
Method: GET
- HTTP
- Javascript
- PHP
- Python
- Ruby
- Java
- cURL
- C#
- Go
Sample Request
GET /api/webhook/:webhook_id HTTP/1.1
Host: api.amlwatcher.com
Authorization: Bearer Token
Sample Request
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer Token");
var requestOptions = {
method: "GET",
headers: myHeaders,
redirect: "follow",
};
fetch("https://api.amlwatcher.com/api/webhook/:webhook_id", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.log("error", error));
Sample Request
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.amlwatcher.com/api/webhook/:webhook_id',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer Token'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Sample Request
import requests
url = "https://api.amlwatcher.com/api/webhook/:webhook_id"
payload = ""
headers = {
'Authorization': 'Bearer Token'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
Sample Request
require "uri"
require "net/http"
url = URI("https://api.amlwatcher.com/api/webhook/:webhook_id")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer Token"
response = https.request(request)
puts response.read_body
Sample Request
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class Main {
public static void main(String[] args) {
try {
// Replace :webhook_id with the actual webhook ID
String webhookId = "your_webhook_id";
String urlString = "https://api.amlwatcher.com/api/webhook/" + webhookId;
URL url = new URL(urlString);
HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
httpURLConnection.setRequestMethod("GET");
httpURLConnection.setRequestProperty("Authorization", "Bearer Token");
int responseCode = httpURLConnection.getResponseCode();
System.out.println("Response Code: " + responseCode);
BufferedReader in;
if (responseCode >= 200 && responseCode < 300) {
in = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()));
} else {
in = new BufferedReader(new InputStreamReader(httpURLConnection.getErrorStream()));
}
String inputLine;
StringBuilder response = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println("Response: " + response.toString());
httpURLConnection.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Sample Request
curl --location --request GET 'https://api.amlwatcher.com/api/webhook/:webhook_id'
--header 'Authorization: Bearer Token'
Sample Request
using RestSharp; // Import RestSharp namespace
using System;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
string webhookId = "your_webhook_id_here";
var url = "https://api.amlwatcher.com";
var options = new RestClientOptions(url)
{
ThrowOnAnyError = true,
Timeout = TimeSpan.FromMilliseconds(-1)
};
var client = new RestClient(options);
var requestUrl = $"/api/webhook/{webhookId}";
var request = new RestRequest(requestUrl, Method.Get);
request.AddHeader("Authorization", "Bearer Token");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
}
}
Sample Request
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.amlwatcher.com/api/webhook/:webhook_id"
method := "GET"
payload := strings.NewReader(``)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Bearer Token")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Request
Parameters | Required | Type | Description |
---|---|---|---|
webhook_id | Yes | String | It is the unique Id, assigned with each webhook. |
Response
Parameters | Description |
---|---|
error | Whenever there is an error in your request, this param will have details of that error; otherwise it’ll remain empty. |
status | The status field is set to either “SUCCESS” or “FAIL”, indicating that the API request resulted in a successful or failure/error condition respectively. |
data | An array/object containing the actual response elements. |
Sample Respone
{
"data": {
"message": "Webhook deleted successfully"
},
"error": false,
"status": "SUCCESS"
}