Delete
To delete an existing webhook you need to execute a DELETE request against the /webhooks/:id endpoint.
The id uniquely identifies the webhook and you can find it in the create webhook response.
This is a destructive operation and webhook requests won't be send anymore to the deleted webhook.
Request
curl --request DELETE \
  --url https://api.digitalsamba.com/api/v1/webhooks/7adb1f07-db15-4cdc-8bf0-2be746fcec2a \
  --user YOUR_TEAM_ID:YOUR_DEVELOPER_KEYimport com.fasterxml.jackson.databind.ObjectMapper;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.util.Base64;
import java.util.Map;
String TEAM_ID = "YOUR_TEAM_ID";
String DEVELOPER_KEY = "YOUR_DEVELOPER_KEY";
String authorizationHeader = "Bearer " + Base64.getEncoder().encodeToString((TEAM_ID + ":" + DEVELOPER_KEY).getBytes());
//Put your webhook id here - this value is just an example
String webhookId = "7adb1f07-db15-4cdc-8bf0-2be746fcec2a";
HttpRequest request = HttpRequest.newBuilder()
  .DELETE()
  .uri(new URI("https://api.digitalsamba.com/api/v1/webhooks/" + webhookId))
  .header("Authorization", authorizationHeader)
  .build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());
System.out.println("Status code: " + response.statusCode());
System.out.println("Body: " + response.body());Response (204 -> No Content)
Response is empty because the webhook was deleted and there is no content to return.
Last updated