Sanctions Search API: v2

<back to all web services

GetClients

Clients
The following routes are available for this service:
GET/clientsGet all clients
"use strict";
export class Authentication {
    /** @param {{apiUserId?:string,apiUserKey?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {string}
     * @description The API User ID provided by us when you signed up to use our API */
    apiUserId;
    /**
     * @type {string}
     * @description The API User Key provided by us when you signed up to use our API */
    apiUserKey;
}
export class BaseRequest {
    /** @param {{authentication?:Authentication}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {Authentication}
     * @description The authentication credentials */
    authentication;
}
export class PagedRequest extends BaseRequest {
    /** @param {{page_limit_?:number,page_offset_?:number,sort?:string,authentication?:Authentication}} [init] */
    constructor(init) { super(init); Object.assign(this, init) }
    /**
     * @type {number}
     * @description The maximum number of records to be returned in one page */
    page_limit_;
    /**
     * @type {number}
     * @description The starting point in the list of records from where the data should be fetched. Zero based index. */
    page_offset_;
    /**
     * @type {string}
     * @description The term to determine the order in which the data is returned */
    sort;
}
/** @typedef {'Undefined'|'PendingCompletion'|'PendingOcr'|'PendingVerification'|'Verified'} */
export var ClientState;
(function (ClientState) {
    ClientState["Undefined"] = "Undefined"
    ClientState["PendingCompletion"] = "PendingCompletion"
    ClientState["PendingOcr"] = "PendingOcr"
    ClientState["PendingVerification"] = "PendingVerification"
    ClientState["Verified"] = "Verified"
})(ClientState || (ClientState = {}));
export class GetClients extends PagedRequest {
    /** @param {{state?:ClientState,isValidateMe?:boolean,name?:string,dateFrom?:string,dateTo?:string,subUserName?:string,page_limit_?:number,page_offset_?:number,sort?:string,authentication?:Authentication}} [init] */
    constructor(init) { super(init); Object.assign(this, init) }
    /**
     * @type {ClientState}
     * @description Filter the results to those that have a State matching the state specified */
    state;
    /**
     * @type {?boolean}
     * @description Filter the results to those that have a IsValidateMe flag matching the specified value */
    isValidateMe;
    /**
     * @type {string}
     * @description Filter the results to those that have a Name including the specified value */
    name;
    /**
     * @type {string}
     * @description Filter the results to those that were created after (or on) this date */
    dateFrom;
    /**
     * @type {string}
     * @description Filter the results to those that were created before this date */
    dateTo;
    /**
     * @type {string}
     * @description If the searches are being accessed by a sub user, specify their username here to only return searches they have permissions to view */
    subUserName;
}
export class Links {
    /** @param {{self?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    self;
}
export class Image {
    /** @param {{id?:number,name?:string,ocrId?:number,url?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    id;
    /** @type {string} */
    name;
    /** @type {?number} */
    ocrId;
    /** @type {string} */
    url;
}
export class ClientShort {
    /** @param {{id?:number,dateCreated?:string,name?:string,reference?:string,isValidateMe?:boolean,state?:ClientState,links?:Links,numOfDocuments?:number,photo?:Image}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    id;
    /** @type {string} */
    dateCreated;
    /** @type {string} */
    name;
    /** @type {string} */
    reference;
    /** @type {boolean} */
    isValidateMe;
    /** @type {ClientState} */
    state;
    /** @type {Links} */
    links;
    /** @type {number} */
    numOfDocuments;
    /** @type {Image} */
    photo;
}
export class ArrayOfClientShort extends Array {
    constructor(init) { super(init); Object.assign(this, init) }
}
export class GetClientsData extends PagedResponse {
    /** @param {{clients?:ArrayOfClientShort,meta?:Meta<T>,responseStatus?:ResponseStatus}} [init] */
    constructor(init) { super(init); Object.assign(this, init) }
    /** @type {ArrayOfClientShort} */
    clients;
}
export class GetClientsResponse {
    /** @param {{data?:GetClientsData}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {GetClientsData} */
    data;
}
export class ResponseError {
    /** @param {{errorCode?:string,fieldName?:string,message?:string,meta?:{ [index: string]: string; }}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    errorCode;
    /** @type {string} */
    fieldName;
    /** @type {string} */
    message;
    /** @type {{ [index: string]: string; }} */
    meta;
}
export class ArrayOfResponseError extends Array {
    constructor(init) { super(init); Object.assign(this, init) }
}
export class ResponseStatus {
    /** @param {{errorCode?:string,message?:string,stackTrace?:string,errors?:ArrayOfResponseError,meta?:{ [index: string]: string; }}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    errorCode;
    /** @type {string} */
    message;
    /** @type {string} */
    stackTrace;
    /** @type {ArrayOfResponseError} */
    errors;
    /** @type {{ [index: string]: string; }} */
    meta;
}
export class BaseResponse {
    /** @param {{responseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {ResponseStatus}
     * @description The status of the response */
    responseStatus;
}
/** @typedef T {any} */
export class PagedResponse extends BaseResponse {
    /** @param {{meta?:Meta<T>,responseStatus?:ResponseStatus}} [init] */
    constructor(init) { super(init); Object.assign(this, init) }
    /**
     * @type {Meta<T>}
     * @description The response Metadata */
    meta;
}
export class MetaLinks extends Links {
    /** @param {{first?:string,last?:string,next?:string,prev?:string,self?:string}} [init] */
    constructor(init) { super(init); Object.assign(this, init) }
    /**
     * @type {string}
     * @description The link to the first page of records */
    first;
    /**
     * @type {string}
     * @description The link to the last page of records */
    last;
    /**
     * @type {string}
     * @description The link to the next page of records, if applicable */
    next;
    /**
     * @type {string}
     * @description The link to the last page of records, if applicable */
    prev;
}
/** @typedef T {any} */
export class Meta {
    /** @param {{links?:MetaLinks,totalCount?:number,pageLimit?:number,pageOffset?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {MetaLinks}
     * @description Pagination links */
    links;
    /**
     * @type {?number}
     * @description The total number of records for the query */
    totalCount;
    /**
     * @type {?number}
     * @description The maximum number of records to be returned in one page */
    pageLimit;
    /**
     * @type {?number}
     * @description The starting point in the list of records from where the data should be fetched. Zero based index. */
    pageOffset;
}

JavaScript GetClients DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /clients HTTP/1.1 
Host: api.sanctionssearch.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"data":{"clients":[{"id":0,"dateCreated":"\/Date(-62135596800000-0000)\/","name":"String","reference":"String","isValidateMe":false,"state":"Undefined","links":{"self":"String"},"numOfDocuments":0,"photo":{"id":0,"name":"String","ocrId":0,"url":"String"}}],"meta":{"links":{"first":"String","last":"String","next":"String","prev":"String","self":"String"},"totalCount":0,"pageLimit":0,"pageOffset":0},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}}