Delete Case
The Delete Case endpoint allows you to remove one or more existing media watcher cases from the system. By providing the reference IDs of the cases, you can delete specific cases and their associated data.
Endpoint: https://api.amlwatcher.com/api/adverse-media/delete
Method: POST
- HTTP
- Javascript
- PHP
- Python
- Ruby
- Java
- cURL
- C#
- Go
Sample Request
POST /api/adverse-media/delete HTTP/1.1
Host: api.amlwatcher.com
Authorization: Bearer Token
Content-Type: application/json
Content-Length: 573
{
"adverse_search_references": ["ddabd3c2ae8f1633f1edbb11"],
"reason": "reason for case deletion"
}
Sample Request
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer Token");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
adverse_search_reference: ["ddabd3c2ae8f1633f1edbb11"],
reason: "reason for case deletion",
});
var requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow",
};
fetch("https://api.amlwatcher.com/api/adverse-media/delete", 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/adverse-media/delete',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"adverse_search_references": ["ddabd3c2ae8f1633f1edbb11"],
"reason": "reason for case deletion"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Sample Request
import requests
import json
url = "https://api.amlwatcher.com/api/adverse-media/delete"
payload = json.dumps({
"adverse_search_references": ["ddabd3c2ae8f1633f1edbb11"],
"reason": "reason for case deletion"
})
headers = {
'Authorization': 'Bearer Token',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Sample Request
require "uri"
require "json"
require "net/http"
url = URI("https://api.amlwatcher.com/api/adverse-media/delete")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"adverse_search_references": ["ddabd3c2ae8f1633f1edbb11"],
"reason": "reason for case deletion"
})
response = https.request(request)
puts response.read_body
Sample Request
import java.io.DataOutputStream;
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) {
HttpURLConnection connection = null;
DataOutputStream outputStream = null;
try {
// Define the URL
URL url = new URL("https://api.amlwatcher.com/api/adverse-media/delete");
// Open a connection to the URL
connection = (HttpURLConnection) url.openConnection();
// Set the request method to POST
connection.setRequestMethod("POST");
// Set the request headers
connection.setRequestProperty("Content-Type", "application/json");
connection.setRequestProperty("Authorization", "Bearer Token");
// Enable input/output streams
connection.setDoOutput(true);
// Define the JSON request body
String jsonPayload = "{\n" +
" \"adverse_search_references\": [\"ddabd3c2ae8f1633f1edbb11\"],\n" +
" \"reason\": \"reason for case deletion\",\n" +
"}";
// Write the JSON request body
outputStream = new DataOutputStream(connection.getOutputStream());
outputStream.writeBytes(jsonPayload);
outputStream.flush();
// Get the response code
int responseCode = connection.getResponseCode();
System.out.println("Response Code: " + responseCode);
BufferedReader in;
if (responseCode >= 200 && responseCode < 300) {
in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
} else {
in = new BufferedReader(new InputStreamReader(connection.getErrorStream()));
}
String inputLine;
StringBuilder response = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println("Response: " + response.toString());
connection.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Sample Request
curl --location --request POST 'https://api.amlwatcher.com/api/adverse-media/delete'
--header 'Content-Type: application/json'
--data '{
"adverse_search_references": ["ddabd3c2ae8f1633f1edbb11"],
"reason": "reason for case deletion"
}'
Sample Request
using RestSharp;
using System;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
var options = new RestClientOptions("https://api.amlwatcher.com")
{
ThrowOnAnyError = true,
Timeout = TimeSpan.FromMilliseconds(-1),
};
var client = new RestClient(options);
var request = new RestRequest("/api/adverse-media/delete", Method.Post);
request.AddHeader("Content-Type", "application/json");
var body = new
{
adverse_search_references= ["ddabd3c2ae8f1633f1edbb11"],
reason= "reason for case deletion"
};
request.AddJsonBody(body);
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/adverse-media/delete"
method := "POST"
payload := strings.NewReader(`{
"adverse_search_references": ["ddabd3c2ae8f1633f1edbb11"],
"reason": "reason for case deletion"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
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 |
---|---|---|---|
adverse_search_references | Yes | Array of Strings | A list of reference IDs representing the media watcher cases to be deleted. |
reason | Yes | String | A string providing the reason for deleting the specified adverse search references. This could include details about why the deletion is required, such as redundancy, error correction, or updated information. |
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 containing the actual response elements. |
Sample Response
{
"data": {
"message": "Adverse Media cases deleted successfully"
},
"error": false,
"status": "SUCCESS"
}