sanctionsio / rest_api_examples

Examples code snippets for calling the REST api from popular programming languages
1 stars 0 forks source link

Provide type information for api responses #2

Closed RezaRahmati closed 3 years ago

RezaRahmati commented 3 years ago

Would you please provide information about what api will return, some fields are coming and going based on the search, so as a developer not be able to develop a code that be sure it covers all fields

Till now I extracted this by trial and error

export interface SanctionIoResults<T> {
    count: number;
    next?: string;
    previous?: string;
    results: Array<T>;
}

export interface SanctionIoNameResult {
    name: string;
    source: string;
    entity_number: number;
    type: string;
    programs: Array<string>;
    title: string;
    addresses: Array<string>;
    start_date: string;
    remarks: string;
    citizenships: Array<string>;
    nationalities: Array<string>;
    dates_of_birth: Array<string>;
    places_of_birth: Array<string>;
    source_list_url: string;
    source_information_url: string;
}

export interface SanctionIoPepResult {
    name: string;
    source: string;
    entity_number: number;
    reason: string;
    dates_of_birth: Array<string>;
    score: number;
    import_source_id?: string;
    remarks?: string;
    start_date: string;
    entity_type: string;
    citizenships: Array<string>;
    nationalities: Array<string>;
}
monobot commented 3 years ago

Hello, you can have the whole API specification here: https://app.swaggerhub.com/apis-docs/Sanctions.IO/sanctions-io_api/d8b6c665-a2e7-4346-a53b-c56c0f0210ed