| POST | /dbs | Add a DBS Search |
|---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Authentication:
# @ApiMember(Description="The API User ID provided by us when you signed up to use our API. Can be provided in the request body, or as a header parameter (X-Api-User)", IsRequired=true, ParameterType="header, body")
api_user_id: Optional[str] = None
"""
The API User ID provided by us when you signed up to use our API. Can be provided in the request body, or as a header parameter (X-Api-User)
"""
# @ApiMember(Description="The API User Key provided by us when you signed up to use our API. Can be provided in the request body, or as a header parameter (X-Api-Key)", IsRequired=true, ParameterType="header, body")
api_user_key: Optional[str] = None
"""
The API User Key provided by us when you signed up to use our API. Can be provided in the request body, or as a header parameter (X-Api-Key)
"""
# @ApiMember(Description="The User ID of the user making the request (e.g. a sub user). This is optional but can be used to associate API requests with a specific user, thereby allowing user permissions to be enforced. Can be provided in the body, or as a header parameter (X-User-Id).", ParameterType="header, body")
user_id: Optional[str] = None
"""
The User ID of the user making the request (e.g. a sub user). This is optional but can be used to associate API requests with a specific user, thereby allowing user permissions to be enforced. Can be provided in the body, or as a header parameter (X-User-Id).
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BaseRequest(IBaseRequest):
# @ApiMember(Description="The authentication credentials", IsRequired=true, ParameterType="header, body")
authentication: Optional[Authentication] = None
"""
The authentication credentials
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResponseError:
error_code: Optional[str] = None
field_name: Optional[str] = None
message: Optional[str] = None
meta: Optional[Dict[str, str]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ArrayOfResponseError(List[ResponseError]):
pass
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResponseStatus:
error_code: Optional[str] = None
message: Optional[str] = None
stack_trace: Optional[str] = None
errors: Optional[ArrayOfResponseError] = None
meta: Optional[Dict[str, str]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BaseResponse(IBaseDataResponse, IHasResponseStatus):
# @ApiMember(Description="The status of the response")
response_status: Optional[ResponseStatus] = None
"""
The status of the response
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class LinkedTo:
client_id: Optional[int] = None
id: Optional[int] = None
type: Optional[str] = None
subtype: Optional[str] = None
status: Optional[str] = None
description: Optional[str] = None
is_archived: Optional[bool] = None
name: Optional[str] = None
date: Optional[datetime.datetime] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ArrayOfLinkedTo(List[LinkedTo]):
pass
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ApplicantInformation:
name: Optional[str] = None
date_of_birth: Optional[str] = None
email: Optional[str] = None
mobile_international: Optional[str] = None
job_location: Optional[str] = None
reference: Optional[str] = None
applicant_pin: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DbsSearchSummary:
id: int = 0
date_searched: datetime.datetime = datetime.datetime(1, 1, 1)
date_updated: datetime.datetime = datetime.datetime(1, 1, 1)
status: Optional[str] = None
disclosure_status: Optional[str] = None
is_applicant_info_completed: bool = False
is_id_check_completed: bool = False
is_application_completed: bool = False
is_application_submitted: bool = False
is_application_disclosed: bool = False
disclosure_level: Optional[str] = None
applicant_information: Optional[ApplicantInformation] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AddDbsSearchData(BaseResponse, IBaseSearchResponse):
linked_to: Optional[ArrayOfLinkedTo] = None
summary: Optional[DbsSearchSummary] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AddDbsSearchResponse:
data: Optional[AddDbsSearchData] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AddDbsSearchRequest:
# @ApiMember(Description="The full name of the applicant", IsRequired=true)
name: Optional[str] = None
"""
The full name of the applicant
"""
# @ApiMember(Description="The date of birth for the applicant (DD/MM/YYYY format)", IsRequired=true)
date_of_birth: Optional[str] = None
"""
The date of birth for the applicant (DD/MM/YYYY format)
"""
# @ApiMember(Description="The email address of the applicant", IsRequired=true)
email: Optional[str] = None
"""
The email address of the applicant
"""
# @ApiMember(Description="The applicant's mobile phone number in international format (e.g. '+447123456789')", IsRequired=true)
mobile_international: Optional[str] = None
"""
The applicant's mobile phone number in international format (e.g. '+447123456789')
"""
# @ApiMember(Description="The country where the job is located", IsRequired=true)
job_location: Optional[str] = None
"""
The country where the job is located
"""
# @ApiMember(Description="The disclosure level of the DBS required", IsRequired=true)
disclosure_level: Optional[str] = None
"""
The disclosure level of the DBS required
"""
# @ApiMember(Description="Your reference, if any")
reference: Optional[str] = None
"""
Your reference, if any
"""
# @ApiMember(Description="If this is specified, the search will be created for the specified sub user, otherwise it will be created in the main user account")
sub_user_name: Optional[str] = None
"""
If this is specified, the search will be created for the specified sub user, otherwise it will be created in the main user account
"""
# @ApiMember(Description="If the search should be linked to other searches, specify the them here")
linked_to: Optional[ArrayOfLinkedTo] = None
"""
If the search should be linked to other searches, specify the them here
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AddDbsSearch(BaseRequest):
request: Optional[AddDbsSearchRequest] = None
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /dbs HTTP/1.1
Host: api.sanctionssearch.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<AddDbsSearch xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
<Authentication>
<ApiUserId>String</ApiUserId>
<ApiUserKey>String</ApiUserKey>
<UserId>String</UserId>
</Authentication>
<Request>
<DateOfBirth>String</DateOfBirth>
<DisclosureLevel>String</DisclosureLevel>
<Email>String</Email>
<JobLocation>String</JobLocation>
<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>
<MobileInternational>String</MobileInternational>
<Name>String</Name>
<Reference>String</Reference>
<SubUserName>String</SubUserName>
</Request>
</AddDbsSearch>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<AddDbsSearchResponse 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>
<Summary>
<ApplicantInformation>
<ApplicantPin>String</ApplicantPin>
<DateOfBirth>String</DateOfBirth>
<Email>String</Email>
<JobLocation>String</JobLocation>
<MobileInternational>String</MobileInternational>
<Name>String</Name>
<Reference>String</Reference>
</ApplicantInformation>
<DateSearched>0001-01-01T00:00:00</DateSearched>
<DateUpdated>0001-01-01T00:00:00</DateUpdated>
<DisclosureLevel>String</DisclosureLevel>
<DisclosureStatus>String</DisclosureStatus>
<Id>0</Id>
<IsApplicantInfoCompleted>false</IsApplicantInfoCompleted>
<IsApplicationCompleted>false</IsApplicationCompleted>
<IsApplicationDisclosed>false</IsApplicationDisclosed>
<IsApplicationSubmitted>false</IsApplicationSubmitted>
<IsIdCheckCompleted>false</IsIdCheckCompleted>
<Status>String</Status>
</Summary>
</Data>
</AddDbsSearchResponse>