Get all Searches
This endpoint allows you to retrieve a list of all searches that belong to the specified organization. It provides you with a comprehensive overview of all searches and associated metadata. It is especially useful for managing and monitoring searches, ensuring that you have access to all relevant information.
Endpoint: https://api.amlwatcher.com/api/searches
Method: POST
- HTTP
- Javascript
- PHP
- Python
- Ruby
- Java
- cURL
- C#
- Go
Sample Request
POST /api/searches HTTP/1.1
Host: api.amlwatcher.com
Authorization: Bearer Token
Content-Type: application/json
Content-Length: 48
{
"page": "1",
"records_per_page": "6"
}
Sample Request
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer Token");
myHeaders.append("Content-Type", "application/json");
var payload = JSON.stringify({
page: "1",
records_per_page: "6",
});
var requestOptions = {
method: "POST",
headers: myHeaders,
body: payload,
redirect: "follow",
};
fetch("https://api.amlwatcher.com/api/searches", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error("error", error));
Sample Request
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.amlwatcher.com/api/searches',
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_HTTPHEADER => array(
'Authorization: Bearer Token'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Sample Request
import requests
url = "https://api.amlwatcher.com/api/searches"
payload = json.dumps({
"page": "1",
"records_per_page": "6"
})
headers = {
'Authorization': 'Bearer Token'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Sample Request
require "uri"
require "net/http"
require "json"
url = URI("https://api.amlwatcher.com/api/searches")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer Token"
request["Content-Type"] = "application/json"
payload = {}.to_json
request.body = payload
response = https.request(request)
puts response.read_body
Sample Request
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
public class Main {
public static void main(String[] args) {
HttpURLConnection connection = null;
DataOutputStream outputStream = null;
BufferedReader in = null;
try {
// Define the URL
URL url = new URL("https://api.amlwatcher.com/api/searches");
// 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("Authorization", "Bearer Token");
connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=---boundary");
// Enable input/output streams
connection.setDoOutput(true);
// Define the boundary and other multipart data
String boundary = "---boundary";
String lineEnd = "\r\n";
String twoHyphens = "--";
// Define the multipart request body
String requestBody = twoHyphens + boundary + lineEnd +
"Content-Disposition: form-data; name=\"file\";filename=\"file.txt\"" + lineEnd +
lineEnd +
"Content of the file" + lineEnd +
twoHyphens + boundary + twoHyphens + lineEnd;
// Write the multipart request body
outputStream = new DataOutputStream(connection.getOutputStream());
outputStream.writeBytes(requestBody);
outputStream.flush();
// Get the response code
int responseCode = connection.getResponseCode();
System.out.println("Response Code: " + responseCode);
// Read the response
in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
StringBuilder response = new StringBuilder();
String inputLine;
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
// Print the response
System.out.println("Response Body: " + response.toString());
} catch (IOException e) {
e.printStackTrace();
// Print the error response if available
if (connection != null) {
try (BufferedReader errorReader = new BufferedReader(new InputStreamReader(connection.getErrorStream()))) {
StringBuilder errorResponse = new StringBuilder();
String errorLine;
while ((errorLine = errorReader.readLine()) != null) {
errorResponse.append(errorLine);
}
System.out.println("Error Response: " + errorResponse.toString());
} catch (IOException ignored) {
}
}
} finally {
// Close resources
try {
if (outputStream != null) outputStream.close();
if (in != null) in.close();
} catch (IOException ignored) {
}
}
}
}
Sample Request
curl --location --request POST 'https://api.amlwatcher.com/api/searches' \
--header 'Authorization: Bearer Token'
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/searches", Method.Post);
request.AddHeader("Authorization", "Bearer Token");
request.AddHeader("Content-Type", "application/json");
var payload = new {
page = "1",
records_per_page = "6"
};
request.AddJsonBody(payload);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
}
}
Sample Request
package main
import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.amlwatcher.com/api/searches"
method := "POST"
payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Bearer Token")
req.Header.Set("Content-Type", writer.FormDataContentType())
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 |
---|---|---|---|
created_at | No | String | Allows the user to retrieve date specific search information. Format: DD-MM-YYYY |
page | No | String / Integer | It indicates the current page number. Default: 1 |
records_per_page | No | String / Integer | It allow the users to specify the number of search records they want to receive on each page. Default: 15 |
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": {
"pagination": {
"current_page": 1,
"records_per_page": 15,
"total_pages": 5,
"total_records": 62
},
"searches": [
{
"_id": {
"$oid": "6538c019b2827e7f3487"
},
"assignees": [
{
"assigned_at": {
"$date": 1698225209114
},
"assigned_to": "6512d715dadd17911a2956",
"assignee_id": "6512d715dadd1b871a2956",
"email": "[email protected]",
"name": "Admin"
}
],
"client_reference": "",
"comments": [],
"created_at": {
"$date": 1698225209114
},
"is_monitored": false,
"is_updated": false,
"match_status": "Potential Match",
"organization_id": {
"$oid": "6512d7134bb9ce3c1394"
},
"platform": "BACKOFFICE",
"search_filters": {
"birth_incorporation_date": "",
"categories": [
"Fitness and Probity",
"Warnings and Regulatory Enforcement",
"Sanctions",
"PEP Level 1",
"PEP Level 2",
"PEP Level 3",
"PEP Level 4",
"PEP"
],
"match_score": 100,
"name": "Keith Campbell",
"unique_identifier": ""
},
"search_reference": "8d13c6a1a80d0a77d6b5a0",
"total_results": 6,
"updated_at": {
"$date": 1698225209114
},
"user_id": {
"$oid": "6512d715dadd111a2956"
}
}
]
},
"error": false,
"status": "SUCCESS"
}