POST | /clients | Add a client |
---|
"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 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;
}
export class LinkedTo {
/** @param {{clientId?:number,id?:number,type?:string,subtype?:string,status?:string,description?:string,isArchived?:boolean,name?:string,date?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {?number} */
clientId;
/** @type {?number} */
id;
/** @type {?string} */
type;
/** @type {?string} */
subtype;
/** @type {?string} */
status;
/** @type {?string} */
description;
/** @type {?boolean} */
isArchived;
/** @type {?string} */
name;
/** @type {?string} */
date;
}
export class ArrayOfLinkedTo extends Array {
constructor(init) { super(init); Object.assign(this, init) }
}
/** @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 Face {
/** @param {{age?:number,gender?:string,emotion?:string,smile?:number,hairColour?:string,facialHair?:string,makeup?:string,glasses?:string,accessories?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {?number} */
age;
/** @type {string} */
gender;
/** @type {string} */
emotion;
/** @type {?number} */
smile;
/** @type {string} */
hairColour;
/** @type {string} */
facialHair;
/** @type {string} */
makeup;
/** @type {string} */
glasses;
/** @type {string} */
accessories;
}
export class VideoTimestamp {
/** @param {{tagName?:string,milli?:number,imageUrl?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
tagName;
/** @type {?number} */
milli;
/** @type {string} */
imageUrl;
}
export class Video {
/** @param {{id?:number,videoUrl?:string,imageUrl?:string,videoTimestamps?:VideoTimestamp[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
id;
/** @type {string} */
videoUrl;
/** @type {string} */
imageUrl;
/** @type {VideoTimestamp[]} */
videoTimestamps;
}
export class Location {
/** @param {{latitude?:number,longitude?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
latitude;
/** @type {number} */
longitude;
}
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 ArrayOfImages extends Array {
constructor(init) { super(init); Object.assign(this, init) }
}
export class PassportChipData {
/** @param {{isIssuerVerified?:boolean,issuerCommonName?:string,issuerOrganisationName?:string,issuerCountry?:string,mrzLine1?:string,mrzLine2?:string,isMrzLine1Verified?:boolean,isMrzLine2Verified?:boolean,dataGroupsVerified?:number[],dataGroupsFailed?:number[],isFaceMatch?:boolean,faceMatchConfidence?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {boolean} */
isIssuerVerified;
/** @type {string} */
issuerCommonName;
/** @type {string} */
issuerOrganisationName;
/** @type {string} */
issuerCountry;
/** @type {string} */
mrzLine1;
/** @type {string} */
mrzLine2;
/** @type {boolean} */
isMrzLine1Verified;
/** @type {boolean} */
isMrzLine2Verified;
/** @type {number[]} */
dataGroupsVerified;
/** @type {number[]} */
dataGroupsFailed;
/** @type {boolean} */
isFaceMatch;
/** @type {?number} */
faceMatchConfidence;
}
export class Passport {
/** @param {{clientFileId?:number,firstName?:string,middleName?:string,lastName?:string,dateOfBirth?:string,gender?:string,mrzLineOne?:string,mrzLineTwo1?:string,mrzLineTwo2?:string,mrzLineTwo3?:string,mrzLineTwo4?:string,mrzLineTwo5?:string,mrzLineTwo6?:string,mrzLineTwo7?:string,mrzLineTwo8?:string,images?:ArrayOfImages,isVerified?:boolean,isFaceMatch?:boolean,faceMatchConfidence?:number,hasPcvSearch?:boolean,hasDfaSearch?:boolean,isPassportChipVerified?:boolean,passportChipData?:PassportChipData,isEligibleForPcv?:boolean,isEligibleForDfa?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
clientFileId;
/** @type {string} */
firstName;
/** @type {string} */
middleName;
/** @type {string} */
lastName;
/** @type {string} */
dateOfBirth;
/** @type {string} */
gender;
/** @type {string} */
mrzLineOne;
/** @type {string} */
mrzLineTwo1;
/** @type {string} */
mrzLineTwo2;
/** @type {string} */
mrzLineTwo3;
/** @type {string} */
mrzLineTwo4;
/** @type {string} */
mrzLineTwo5;
/** @type {string} */
mrzLineTwo6;
/** @type {string} */
mrzLineTwo7;
/** @type {string} */
mrzLineTwo8;
/** @type {ArrayOfImages} */
images;
/** @type {boolean} */
isVerified;
/** @type {?boolean} */
isFaceMatch;
/** @type {?number} */
faceMatchConfidence;
/** @type {boolean} */
hasPcvSearch;
/** @type {boolean} */
hasDfaSearch;
/** @type {?boolean} */
isPassportChipVerified;
/** @type {PassportChipData} */
passportChipData;
/** @type {boolean} */
isEligibleForPcv;
/** @type {boolean} */
isEligibleForDfa;
}
export class ArrayOfPassports extends Array {
constructor(init) { super(init); Object.assign(this, init) }
}
export class DrivingLicence {
/** @param {{clientFileId?:number,firstName?:string,middleName?:string,lastName?:string,dateOfBirth?:string,address?:string,drivingLicenceNumber?:string,images?:ArrayOfImages,isVerified?:boolean,isFaceMatch?:boolean,faceMatchConfidence?:number,hasDfaSearch?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
clientFileId;
/** @type {string} */
firstName;
/** @type {string} */
middleName;
/** @type {string} */
lastName;
/** @type {string} */
dateOfBirth;
/** @type {string} */
address;
/** @type {string} */
drivingLicenceNumber;
/** @type {ArrayOfImages} */
images;
/** @type {boolean} */
isVerified;
/** @type {?boolean} */
isFaceMatch;
/** @type {?number} */
faceMatchConfidence;
/** @type {boolean} */
hasDfaSearch;
}
export class ArrayOfDrivingLicences extends Array {
constructor(init) { super(init); Object.assign(this, init) }
}
export class OtherDocument {
/** @param {{clientFileId?:number,type?:string,typeOther?:string,description?:string,originalImageUrl?:string,croppedImageUrl?:string,isVerified?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
clientFileId;
/** @type {string} */
type;
/** @type {string} */
typeOther;
/** @type {string} */
description;
/** @type {string} */
originalImageUrl;
/** @type {string} */
croppedImageUrl;
/** @type {boolean} */
isVerified;
}
export class ArrayOfOtherDocuments extends Array {
constructor(init) { super(init); Object.assign(this, init) }
}
export class ProofOfDocument {
/** @param {{id?:number,name?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {number}
* @description The ID of the ProofOfDocument */
id;
/**
* @type {string}
* @description The name of the ProofOfDocument */
name;
}
export class ArrayOfProofOfDocuments extends Array {
constructor(init) { super(init); Object.assign(this, init) }
}
export class ProofOfDocumentCategory {
/** @param {{id?:number,proofOf?:string,proofOfDocuments?:ArrayOfProofOfDocuments}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {number}
* @description The ID of the ProofOfDocumentCategory */
id;
/**
* @type {string}
* @description The category or subject that requires proof (e.g., 'Name', 'Address', 'Right to work') */
proofOf;
/**
* @type {ArrayOfProofOfDocuments}
* @description The documents that can be used to provide proof for the specified category. */
proofOfDocuments;
}
export class ArrayOfProofOfDocumentCategories extends Array {
constructor(init) { super(init); Object.assign(this, init) }
}
export class Client {
/** @param {{id?:number,dateCreated?:string,name?:string,email?:string,reference?:string,state?:ClientState,mobileInternational?:string,postCode?:string,isValidateMe?:boolean,face?:Face,video?:Video,location?:Location,numOfDocuments?:number,passports?:ArrayOfPassports,drivingLicences?:ArrayOfDrivingLicences,otherDocuments?:ArrayOfOtherDocuments,proofOfDocumentCategories?:ArrayOfProofOfDocumentCategories}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
id;
/** @type {string} */
dateCreated;
/** @type {string} */
name;
/** @type {string} */
email;
/** @type {string} */
reference;
/** @type {ClientState} */
state;
/** @type {string} */
mobileInternational;
/** @type {string} */
postCode;
/** @type {boolean} */
isValidateMe;
/** @type {Face} */
face;
/** @type {Video} */
video;
/** @type {Location} */
location;
/** @type {number} */
numOfDocuments;
/** @type {ArrayOfPassports} */
passports;
/** @type {ArrayOfDrivingLicences} */
drivingLicences;
/** @type {ArrayOfOtherDocuments} */
otherDocuments;
/** @type {ArrayOfProofOfDocumentCategories} */
proofOfDocumentCategories;
}
export class AddClientData extends BaseResponse {
/** @param {{linkedTo?:ArrayOfLinkedTo,client?:Client,responseStatus?:ResponseStatus}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/** @type {ArrayOfLinkedTo} */
linkedTo;
/** @type {Client} */
client;
}
export class AddClientResponse {
/** @param {{data?:AddClientData}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {AddClientData} */
data;
}
/** @typedef {'Undefined'|'ValidateMe'|'PassportChipVerification'} */
export var CreateMobileClientType;
(function (CreateMobileClientType) {
CreateMobileClientType["Undefined"] = "Undefined"
CreateMobileClientType["ValidateMe"] = "ValidateMe"
CreateMobileClientType["PassportChipVerification"] = "PassportChipVerification"
})(CreateMobileClientType || (CreateMobileClientType = {}));
export class AddClientRequest {
/** @param {{name?:string,email?:string,mobileInternational?:string,postCode?:string,proofOfPreset?:CreateMobileClientType,proofOfDocumentCategories?:ArrayOfProofOfDocumentCategories,linkedTo?:ArrayOfLinkedTo}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description The full name of the client */
name;
/**
* @type {string}
* @description The email address of the client */
email;
/**
* @type {string}
* @description The client's mobile phone number in international format (e.g. '+447123456789') */
mobileInternational;
/**
* @type {string}
* @description The postal code of the client's address. Used in emails sent to the client to help them recognize the communication as genuine */
postCode;
/**
* @type {CreateMobileClientType}
* @description Specifies the type of ValidateMe preset. Possible values are 'ValidateMe' for configuring RequiredDocuments, or 'PassportChipVerification' for setting the Passport as Proof of Name */
proofOfPreset;
/**
* @type {ArrayOfProofOfDocumentCategories}
* @description The categories of proof and selected documents that the client can use to provide proof. Required if ClientType is set to 'ValidateMe' */
proofOfDocumentCategories;
/**
* @type {ArrayOfLinkedTo}
* @description If the client should be linked to other searches, specify the them here */
linkedTo;
}
export class AddClient extends BaseRequest {
/** @param {{request?:AddClientRequest,authentication?:Authentication}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/** @type {AddClientRequest} */
request;
}
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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /clients HTTP/1.1
Host: api.sanctionssearch.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"request":{"name":"String","email":"String","mobileInternational":"String","postCode":"String","proofOfPreset":"Undefined","proofOfDocumentCategories":[{"id":0,"proofOf":"String","proofOfDocuments":[{"id":0,"name":"String"}]}],"linkedTo":[{"clientId":0,"id":0,"type":"String","subtype":"String","status":"String","description":"String","isArchived":false,"name":"String","date":"\/Date(-62135596800000-0000)\/"}]},"authentication":{"apiUserId":"String","apiUserKey":"String"}}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"data":{"linkedTo":[{"clientId":0,"id":0,"type":"String","subtype":"String","status":"String","description":"String","isArchived":false,"name":"String","date":"\/Date(-62135596800000-0000)\/"}],"client":{"id":0,"dateCreated":"\/Date(-62135596800000-0000)\/","name":"String","email":"String","reference":"String","state":"Undefined","mobileInternational":"String","postCode":"String","isValidateMe":false,"face":{"age":0,"gender":"String","emotion":"String","smile":0,"hairColour":"String","facialHair":"String","makeup":"String","glasses":"String","accessories":"String"},"video":{"id":0,"videoUrl":"String","imageUrl":"String","videoTimestamps":[{"tagName":"String","milli":0,"imageUrl":"String"}]},"location":{"latitude":0,"longitude":0},"numOfDocuments":0,"passports":[{"clientFileId":0,"firstName":"String","middleName":"String","lastName":"String","dateOfBirth":"String","gender":"String","mrzLineOne":"String","mrzLineTwo1":"String","mrzLineTwo2":"String","mrzLineTwo3":"String","mrzLineTwo4":"String","mrzLineTwo5":"String","mrzLineTwo6":"String","mrzLineTwo7":"String","mrzLineTwo8":"String","images":[{"id":0,"name":"String","ocrId":0,"url":"String"}],"isVerified":false,"isFaceMatch":false,"faceMatchConfidence":0,"hasPcvSearch":false,"hasDfaSearch":false,"isPassportChipVerified":false,"passportChipData":{"isIssuerVerified":false,"issuerCommonName":"String","issuerOrganisationName":"String","issuerCountry":"String","mrzLine1":"String","mrzLine2":"String","isMrzLine1Verified":false,"isMrzLine2Verified":false,"dataGroupsVerified":[0],"dataGroupsFailed":[0],"isFaceMatch":false,"faceMatchConfidence":0},"isEligibleForPcv":false,"isEligibleForDfa":false}],"drivingLicences":[{"clientFileId":0,"firstName":"String","middleName":"String","lastName":"String","dateOfBirth":"String","address":"String","drivingLicenceNumber":"String","images":[{"id":0,"name":"String","ocrId":0,"url":"String"}],"isVerified":false,"isFaceMatch":false,"faceMatchConfidence":0,"hasDfaSearch":false}],"otherDocuments":[{"clientFileId":0,"type":"String","typeOther":"String","description":"String","originalImageUrl":"String","croppedImageUrl":"String","isVerified":false}],"proofOfDocumentCategories":[{"id":0,"proofOf":"String","proofOfDocuments":[{"id":0,"name":"String"}]}]},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}}