Sanctions Search API: v2

<back to all web services

GetPepSearch

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(){}
}


Swift GetPepSearch DTOs

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

HTTP + SOAP12

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

POST /soap12 HTTP/1.1 
Host: api.sanctionssearch.com 
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>

<GetPepSearch xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
  <Authentication>
    <ApiUserId>String</ApiUserId>
    <ApiUserKey>String</ApiUserKey>
  </Authentication>
  <Request>
    <Id>0</Id>
    <OnlyShowUnresolvedResults>false</OnlyShowUnresolvedResults>
    <SubUserName>String</SubUserName>
  </Request>
</GetPepSearch>

</soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>

<GetPepSearchResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
  <Data>
    <ResponseStatus>
      <ErrorCode>String</ErrorCode>
      <Message>String</Message>
      <StackTrace>String</StackTrace>
      <Errors>
        <ResponseError>
          <ErrorCode>String</ErrorCode>
          <FieldName>String</FieldName>
          <Message>String</Message>
          <Meta xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:KeyValueOfstringstring>
              <d6p1:Key>String</d6p1:Key>
              <d6p1:Value>String</d6p1:Value>
            </d6p1:KeyValueOfstringstring>
          </Meta>
        </ResponseError>
      </Errors>
      <Meta xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:KeyValueOfstringstring>
          <d4p1:Key>String</d4p1:Key>
          <d4p1:Value>String</d4p1:Value>
        </d4p1:KeyValueOfstringstring>
      </Meta>
    </ResponseStatus>
    <LinkedTo>
      <LinkedTo>
        <ClientId>0</ClientId>
        <Date>0001-01-01T00:00:00</Date>
        <Description>String</Description>
        <Id>0</Id>
        <IsArchived>false</IsArchived>
        <Name>String</Name>
        <Status>String</Status>
        <Subtype>String</Subtype>
        <Type>String</Type>
      </LinkedTo>
    </LinkedTo>
    <SearchRecord>
      <AffectedByUpdate>false</AffectedByUpdate>
      <ClientInResults>false</ClientInResults>
      <ClientNotInResults>false</ClientNotInResults>
      <DateArchived>0001-01-01T00:00:00</DateArchived>
      <DateRenewal>0001-01-01T00:00:00</DateRenewal>
      <DateSearched>0001-01-01T00:00:00</DateSearched>
      <DateUpdated>0001-01-01T00:00:00</DateUpdated>
      <Id>0</Id>
      <IsArchived>false</IsArchived>
      <IsDayOneSearch>false</IsDayOneSearch>
      <NumOfResults>0</NumOfResults>
      <SearchCriteria>
        <Address>String</Address>
        <Country>String</Country>
        <DateOfBirth>String</DateOfBirth>
        <Name>String</Name>
        <Nationality>String</Nationality>
        <Reference>String</Reference>
      </SearchCriteria>
      <SearchResults>
        <Results>
          <PepSearchResult>
            <Addresses>
              <PepSearchResultAddress>
                <AddressLine1>String</AddressLine1>
                <AddressLine2>String</AddressLine2>
                <AddressLine3>String</AddressLine3>
                <AddressLine4>String</AddressLine4>
                <Country>String</Country>
                <County>String</County>
                <DateLastUpdated>0001-01-01T00:00:00</DateLastUpdated>
                <ISOCountry>String</ISOCountry>
                <PostCode>String</PostCode>
                <SoftDelete>false</SoftDelete>
                <Town>String</Town>
              </PepSearchResultAddress>
            </Addresses>
            <Aliases>
              <PepSearchResultAlias>
                <AlternateTitle>String</AlternateTitle>
                <BusinessName>String</BusinessName>
                <DateLastUpdated>0001-01-01T00:00:00</DateLastUpdated>
                <DateOfSoftDelete>0001-01-01T00:00:00</DateOfSoftDelete>
                <Forename>String</Forename>
                <MiddleName>String</MiddleName>
                <SoftDelete>false</SoftDelete>
                <Surname>String</Surname>
                <Title>String</Title>
              </PepSearchResultAlias>
            </Aliases>
            <AlternateTitle>String</AlternateTitle>
            <Articles>
              <PepSearchResultArticle>
                <DateLastUpdated>0001-01-01T00:00:00</DateLastUpdated>
                <DateOfCapture>0001-01-01T00:00:00</DateOfCapture>
                <OriginalUrl>String</OriginalUrl>
                <Snippets>
                  <PepSearchResultArticleSnippet>
                    <AdverseTerms>String</AdverseTerms>
                    <Text>String</Text>
                    <Title>String</Title>
                  </PepSearchResultArticleSnippet>
                </Snippets>
                <Source>String</Source>
                <Url>String</Url>
              </PepSearchResultArticle>
            </Articles>
            <Associations>
              <PepSearchResultIndividualAssociation>
                <DateLastUpdated>0001-01-01T00:00:00</DateLastUpdated>
                <FullName>String</FullName>
                <LinkDescription>String</LinkDescription>
                <SoftDelete>false</SoftDelete>
              </PepSearchResultIndividualAssociation>
            </Associations>
            <BusinessAssociations>
              <PepSearchResultBusinessAssociation>
                <BusinessName>String</BusinessName>
                <DateLastUpdated>0001-01-01T00:00:00</DateLastUpdated>
                <LinkDescription>String</LinkDescription>
                <SoftDelete>false</SoftDelete>
              </PepSearchResultBusinessAssociation>
            </BusinessAssociations>
            <BusinessName>String</BusinessName>
            <BusinessTelephone>String</BusinessTelephone>
            <Category>String</Category>
            <DateLastUpdated>0001-01-01T00:00:00</DateLastUpdated>
            <DateOfBirth>0001-01-01T00:00:00</DateOfBirth>
            <DateOfCapture>0001-01-01T00:00:00</DateOfCapture>
            <DateOfDeath>0001-01-01T00:00:00</DateOfDeath>
            <DateOfSoftDelete>0001-01-01T00:00:00</DateOfSoftDelete>
            <Description>String</Description>
            <Email>String</Email>
            <Fax>String</Fax>
            <Forename>String</Forename>
            <Gender>String</Gender>
            <HomeTelephone>String</HomeTelephone>
            <Id>0</Id>
            <Middlename>String</Middlename>
            <MobileTelephone>String</MobileTelephone>
            <Nationality>String</Nationality>
            <Notes>
              <PepSearchResultNote>
                <DateLastUpdated>0001-01-01T00:00:00</DateLastUpdated>
                <Notes>String</Notes>
                <SoftDelete>false</SoftDelete>
                <Source>String</Source>
              </PepSearchResultNote>
            </Notes>
            <PepTier>0</PepTier>
            <Picture>String</Picture>
            <PoliticalPositions>
              <PepSearchResultPoliticalPosition>
                <Country>String</Country>
                <DateLastUpdated>0001-01-01T00:00:00</DateLastUpdated>
                <Description>String</Description>
                <From>String</From>
                <SoftDelete>false</SoftDelete>
                <To>String</To>
              </PepSearchResultPoliticalPosition>
            </PoliticalPositions>
            <ResultIsClient>false</ResultIsClient>
            <ResultResolved>false</ResultResolved>
            <ResultSimilarity>0</ResultSimilarity>
            <SoftDelete>false</SoftDelete>
            <Source>String</Source>
            <Surname>String</Surname>
            <Telephone>String</Telephone>
            <Title>String</Title>
            <Type>String</Type>
            <Website>String</Website>
            <YearOfBirth>0</YearOfBirth>
            <YearOfDeath>0</YearOfDeath>
          </PepSearchResult>
        </Results>
      </SearchResults>
      <SearchType>String</SearchType>
    </SearchRecord>
  </Data>
</GetPepSearchResponse>

</soap12:Body>
</soap12:Envelope>