POST | /peps/get | Get a PEP search |
---|
import Foundation
import ServiceStack
// @DataContract
public class GetPepSearch : BaseRequest
{
// @DataMember
public var request:GetPepSearchRequest
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case request
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
request = try container.decodeIfPresent(GetPepSearchRequest.self, forKey: .request)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if request != nil { try container.encode(request, forKey: .request) }
}
}
// @DataContract
public class BaseRequest : IBaseRequest, Codable
{
/**
* The authentication credentials
*/
// @DataMember
// @ApiMember(Description="The authentication credentials", IsRequired=true, ParameterType="header, body")
public var authentication:Authentication
required public init(){}
}
// @DataContract
public class Authentication : Codable
{
/**
* The API User ID provided by us when you signed up to use our API
*/
// @DataMember
// @ApiMember(Description="The API User ID provided by us when you signed up to use our API", IsRequired=true, ParameterType="header, body")
public var apiUserId:String
/**
* The API User Key provided by us when you signed up to use our API
*/
// @DataMember
// @ApiMember(Description="The API User Key provided by us when you signed up to use our API", IsRequired=true, ParameterType="header, body")
public var apiUserKey:String
required public init(){}
}
public class GetPepSearchRequest : Codable
{
/**
* If the search was created against a single Sub User account, specify their username here
*/
// @ApiMember(Description="If the search was created against a single Sub User account, specify their username here")
public var subUserName:String
/**
* If set to true, the response will exclude resolved search results, it will only include unresolved results
*/
// @ApiMember(Description="If set to true, the response will exclude resolved search results, it will only include unresolved results")
public var onlyShowUnresolvedResults:Bool
public var id:Int
required public init(){}
}
// @DataContract
public class GetPepSearchResponse : Codable
{
// @DataMember
public var data:GetPepSearchData
required public init(){}
}
public class GetPepSearchData : BaseResponse, IBaseSearchResponse
{
public var linkedTo:ArrayOfLinkedTo
public var searchRecord:PepSearchRecord
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case linkedTo
case searchRecord
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
linkedTo = try container.decodeIfPresent(ArrayOfLinkedTo.self, forKey: .linkedTo)
searchRecord = try container.decodeIfPresent(PepSearchRecord.self, forKey: .searchRecord)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if linkedTo != nil { try container.encode(linkedTo, forKey: .linkedTo) }
if searchRecord != nil { try container.encode(searchRecord, forKey: .searchRecord) }
}
}
public class BaseResponse : IBaseDataResponse, IHasResponseStatus, Codable
{
/**
* The status of the response
*/
// @ApiMember(Description="The status of the response")
public var responseStatus:ResponseStatus
required public init(){}
}
public class ArrayOfResponseError : List<ResponseError>
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
public class ArrayOfLinkedTo : List<LinkedTo>
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
public class LinkedTo : Codable
{
public var clientId:Int?
public var id:Int?
public var type:String
public var subtype:String
public var status:String
public var Description:String
public var isArchived:Bool?
public var name:String
public var date:Date?
required public init(){}
}
public class PepSearchRecord : Codable
{
public var id:Int
public var searchType:String
public var dateSearched:Date
public var dateUpdated:Date
public var dateRenewal:Date?
public var dateArchived:Date?
public var isArchived:Bool
public var numOfResults:Int
public var clientInResults:Bool
public var clientNotInResults:Bool
public var affectedByUpdate:Bool
public var isDayOneSearch:Bool
public var searchCriteria:SearchCriteria
public var searchResults:PepSearchResults
required public init(){}
}
public class SearchCriteria : Codable
{
public var name:String
public var address:String
public var country:String
public var dateOfBirth:String
public var nationality:String
public var reference:String
required public init(){}
}
public class PepSearchResults : Codable
{
public var results:[PepSearchResult] = []
required public init(){}
}
public class PepSearchResult : Codable
{
public var resultSimilarity:Double
public var resultResolved:Bool
public var dateLastUpdated:Date
public var resultIsClient:Bool
public var id:Int
public var type:String
public var title:String
public var forename:String
public var middlename:String
public var surname:String
public var softDelete:Bool?
public var dateOfSoftDelete:Date?
public var dateOfCapture:Date?
public var dateOfBirth:Date?
public var dateOfDeath:Date?
public var yearOfBirth:Int?
public var yearOfDeath:Int?
public var gender:String
public var homeTelephone:String
public var businessTelephone:String
public var mobileTelephone:String
public var fax:String
public var email:String
public var nationality:String
public var source:String
public var category:String
public var picture:String
public var alternateTitle:String
public var businessName:String
public var Description:String
public var telephone:String
public var website:String
public var pepTier:Int?
public var addresses:[PepSearchResultAddress] = []
public var aliases:[PepSearchResultAlias] = []
public var articles:[PepSearchResultArticle] = []
public var associations:[PepSearchResultIndividualAssociation] = []
public var businessAssociations:[PepSearchResultBusinessAssociation] = []
public var notes:[PepSearchResultNote] = []
public var politicalPositions:[PepSearchResultPoliticalPosition] = []
required public init(){}
}
public class PepSearchResultAddress : Codable
{
public var addressLine1:String
public var addressLine2:String
public var addressLine3:String
public var addressLine4:String
public var town:String
public var county:String
public var postCode:String
public var country:String
public var isoCountry:String
public var softDelete:Bool?
public var dateLastUpdated:Date
required public init(){}
}
public class PepSearchResultAlias : Codable
{
public var forename:String
public var middleName:String
public var surname:String
public var softDelete:Bool?
public var dateOfSoftDelete:Date?
public var dateLastUpdated:Date
public var title:String
public var alternateTitle:String
public var businessName:String
required public init(){}
}
public class PepSearchResultArticle : Codable
{
public var url:String
public var originalUrl:String
public var source:String
public var dateOfCapture:Date?
public var dateLastUpdated:Date
public var snippets:[PepSearchResultArticleSnippet] = []
required public init(){}
}
public class PepSearchResultArticleSnippet : Codable
{
public var title:String
public var text:String
public var adverseTerms:String
required public init(){}
}
public class PepSearchResultIndividualAssociation : Codable
{
public var linkDescription:String
public var softDelete:Bool?
public var dateLastUpdated:Date
public var fullName:String
required public init(){}
}
public class PepSearchResultBusinessAssociation : Codable
{
public var linkDescription:String
public var softDelete:Bool?
public var dateLastUpdated:Date
public var businessName:String
required public init(){}
}
public class PepSearchResultNote : Codable
{
public var source:String
public var notes:String
public var softDelete:Bool?
public var dateLastUpdated:Date
required public init(){}
}
public class PepSearchResultPoliticalPosition : Codable
{
public var Description:String
public var from:String
public var to:String
public var country:String
public var softDelete:Bool?
public var dateLastUpdated:Date
required public init(){}
}
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 /peps/get HTTP/1.1
Host: api.sanctionssearch.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"request":{"subUserName":"String","onlyShowUnresolvedResults":false,"id":0},"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)\/"}],"searchRecord":{"id":0,"searchType":"String","dateSearched":"\/Date(-62135596800000-0000)\/","dateUpdated":"\/Date(-62135596800000-0000)\/","dateRenewal":"\/Date(-62135596800000-0000)\/","dateArchived":"\/Date(-62135596800000-0000)\/","isArchived":false,"numOfResults":0,"clientInResults":false,"clientNotInResults":false,"affectedByUpdate":false,"isDayOneSearch":false,"searchCriteria":{"name":"String","address":"String","country":"String","dateOfBirth":"String","nationality":"String","reference":"String"},"searchResults":{"results":[{"resultSimilarity":0,"resultResolved":false,"dateLastUpdated":"\/Date(-62135596800000-0000)\/","resultIsClient":false,"id":0,"type":"String","title":"String","forename":"String","middlename":"String","surname":"String","softDelete":false,"dateOfSoftDelete":"\/Date(-62135596800000-0000)\/","dateOfCapture":"\/Date(-62135596800000-0000)\/","dateOfBirth":"\/Date(-62135596800000-0000)\/","dateOfDeath":"\/Date(-62135596800000-0000)\/","yearOfBirth":0,"yearOfDeath":0,"gender":"String","homeTelephone":"String","businessTelephone":"String","mobileTelephone":"String","fax":"String","email":"String","nationality":"String","source":"String","category":"String","picture":"String","alternateTitle":"String","businessName":"String","description":"String","telephone":"String","website":"String","pepTier":0,"addresses":[{"addressLine1":"String","addressLine2":"String","addressLine3":"String","addressLine4":"String","town":"String","county":"String","postCode":"String","country":"String","isoCountry":"String","softDelete":false,"dateLastUpdated":"\/Date(-62135596800000-0000)\/"}],"aliases":[{"forename":"String","middleName":"String","surname":"String","softDelete":false,"dateOfSoftDelete":"\/Date(-62135596800000-0000)\/","dateLastUpdated":"\/Date(-62135596800000-0000)\/","title":"String","alternateTitle":"String","businessName":"String"}],"articles":[{"url":"String","originalUrl":"String","source":"String","dateOfCapture":"\/Date(-62135596800000-0000)\/","dateLastUpdated":"\/Date(-62135596800000-0000)\/","snippets":[{"title":"String","text":"String","adverseTerms":"String"}]}],"associations":[{"linkDescription":"String","softDelete":false,"dateLastUpdated":"\/Date(-62135596800000-0000)\/","fullName":"String"}],"businessAssociations":[{"linkDescription":"String","softDelete":false,"dateLastUpdated":"\/Date(-62135596800000-0000)\/","businessName":"String"}],"notes":[{"source":"String","notes":"String","softDelete":false,"dateLastUpdated":"\/Date(-62135596800000-0000)\/"}],"politicalPositions":[{"description":"String","from":"String","to":"String","country":"String","softDelete":false,"dateLastUpdated":"\/Date(-62135596800000-0000)\/"}]}]}},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}}