General

Lists

General Lists API documentation

Introduction

The list API call is used to get all the people/company records from a specific list.

Get Records

This API will retrieve a list of records.

Path
POST /lists/get

JSON Body:

{
    "lists_id": "5cc77acb-ac7d-46ef-861a-53fa4b513eb5",
    "sort": {
        "field": "people.created_at",
        "sort": "desc"
    },
    "pagination": {
        "perpage": 20,
        "page": 1
    }
}

Please note for a company list use company fields when sorting data: companies.people.created_at

Response for a People list:

{
    "meta": {
        "page": 1,
        "pages": 9,
        "perpage": 20,
        "total": 161,
        "sort": "desc",
        "field": "people.created_at"
    },
    "data": [
        {
            "id": "02d4e47f-599e-45af-8f1e-3744463df89",
            "member_number": "MEM123456",
            "role_lookups_id": "f2ca1ac2-4610-48e8-a264-5b3397c77666",
            "is_active": true,
            "initials": "JG",
            "name": "James",
            "middle_names": "Josh Groben",
            "surname": "May",
            "email": "james@may.com",
            "email_score": 67,
            "id_number": "8012123456758",
            "contact_cell": "+27721234567",
            "contact_work": "+27721234566",
            "contact_home": "+27721234565",
            "contact_fax": "+27721234564",
            "date_deceased": null,
            "title": "Mr",
            "marital": "Not Married",
            "language": "English",
            "gender": "Female",
            "agent_name": "Mary Jue",
            "branch_name": "Head Office",
            "created_at": "2024-02-29T13:42:46.750Z",
            "postal_line_1": "complex",
            "postal_line_2": "street",
            "postal_line_3": "area",
            "postal_line_4": "city",
            "postal_code": "8787",
            "physical_line_1": "complex",
            "physical_line_2": "street",
            "physical_line_3": "area",
            "physical_line_4": "city",
            "physical_code": "7123",
            "is_marketing_sms": true,
            "is_marketing_whatsapp": false,
            "is_marketing_email": true,
            "is_marketing_phone": false,
            "photo": "https://photos.com/123",
            "social_facebook": "https://facebook.com/123",
            "social_linkedin": "https://linkedin.com/123",
            "social_instagram": "https://instagram.com/123",
            "social_twitter": "https://x.com/123",
            "social_pinterest": "https://pinterest.com/123",
            "social_blog": "https://blog.com/123",
            "social_whatsapp": "+27800000008",
            "social_telegram": "+27800000006",
            "public_id": "d017b322059bf5526063989......efaa52f4281954f4e42e8",
            "tax_reference": "0123456789",
            "deal_value": 25457.54,
            "deal_accounts_currencies_code": "ZAR",
            "deal_expected_close_date": "2030-01-01T00:00:00.000Z",
            "is_blacklisted": false,
            "total_successful_transactions": 4,
            "total_failed_transactions": 1,
            "total_subscriptions": 1,
            "total_subscriptions_products": 1,
            "total_active_subscriptions_products": 1,
            "call_last_contacted": "2024-03-25T15:45:54.845Z",
            "date_phone_invalid": null,
            "date_lead_conversion": "2005-12-26T00:00:00.000Z",
            "date_paid_up": "2024-05-01T00:00:00.000Z",
            "address_details_changed_at": "2024-03-16T00:00:00.000Z",
            "contact_details_changed_at": "2024-03-08T00:00:00.000Z",
            "last_engagement_at": "2024-03-26T12:05:15.845Z",
            "status_changed_at": "2024-04-01T04:16:55.551Z",
            "date_id_number_verify": "2024-03-22T15:43:12.541Z",
            "credit_score_cpa": 670,
            "credit_score_nlr": 629,
            "referred_by": "Marcus Black",
            "owner_admins": ["Henco Smith"],
            "companies_name": "Cargo Swift",
            "companies_trading_as": "Cargo Swift Ltd",
            "call_last_contacted_by_agents_title": "Martha Smith",
            "visible_to_title": "Record Owner(s)",
            "municipality_title": "Laingsburg",
            "job_title": "Business Owner",
            "source_of_record_title": "Added"
        },
        ...
    ]
}

Response for a Company list:

{
    "meta": {
        "page": 1,
        "pages": 11,
        "perpage": 20,
        "total": 215,
        "sort": "desc",
        "field": "companies.created_at"
    },
    "data": [
        {
            "id": "6289899c-da07-49b1-9826-5c5b182eb16f",
            "name": "New Corp Inc",
            "trading_as": "New Corp Inc",
            "registration_number": "2002/123456/04",
            "member_number": "MEM123456",
            "email": "jenny@mail.net.za",
            "email_score": 90,
            "contact": "+27721234567",
            "mobile": "+27721234566",
            "fax":  "+27721234565",
            "website": "https://new.corp.com",
            "date_closed": null,
            "postal_line_1": "123 James Street",
            "postal_line_2": "Brooklyn",
            "postal_line_3": "Pretoria",
            "postal_line_4": "Gauteng",
            "postal_code": "0084",
            "physical_line_1": "123 James Street",
            "physical_line_2": "Brooklyn",
            "physical_line_3": "Pretoria",
            "physical_line_4": "Gauteng",
            "physical_code": "0084",
            "is_taxable": false,
            "is_marketing_sms": false,
            "is_marketing_whatsapp": false,
            "is_marketing_email": true,
            "is_marketing_phone": true,
            "is_active": false,
            "tax_reference": "0123456789",
            "type": "Sole proprietorship",
            "country": "South Africa",
            "region": "Gauteng",
            "municipality": "City of Johannesburg",
            "agent_name": "Agent Name",
            "branch_name": "Head Office",
            "created_at": "2022-09-28T06:46:39.203Z",
            "image": "https://images.com/123",
            "social_facebook": "https://facebook.com/123",
            "social_linkedin": "https://linkedin.com/123",
            "social_instagram": "https://instagram.com/123",
            "social_twitter": "https://x.com/123",
            "social_pinterest": "https://pinterest.com/123",
            "social_blog": "https://blog.com/123",
            "social_whatsapp": "+27800000008",
            "social_telegram": "+27800000006",
            "deal_value": 25457.54,
            "deal_accounts_currencies_title": "ZAR",
            "deal_expected_close_date": "2030-01-01T00:00:00.000Z",
            "is_blacklisted": false,
            "total_successful_transactions": 6,
            "total_failed_transactions": 1,
            "total_subscriptions": 1,
            "total_subscriptions_products": 1,
            "total_active_subscriptions_products": 1,
            "call_last_contacted": "2024-03-25T15:45:54.845Z",
            "date_phone_invalid": null,
            "date_lead_conversion": "2005-12-26T00:00:00.000Z",
            "date_paid_up": "2024-05-01T00:00:00.000Z",
            "address_details_changed_at": "2024-03-16T00:00:00.000Z",
            "contact_details_changed_at": "2024-03-08T00:00:00.000Z",
            "last_engagement_at": "2024-03-26T12:05:15.845Z",
            "status_changed_at": "2024-04-01T04:16:55.551Z",
            "referred_by": "Asha Ali",
            "owner_admins": ["Henco Smith"],
            "call_last_contacted_by_agents_title": "Martha Smith",
            "visible_to_title": "Record Owner(s)",
            "source_of_record_title": "Added"
        },
        ...
    ]
}

All lookup values can be found under: Lookups API

Error Response:

{
    "status": false,
    "error": "Not authorized to make this API call. Requesting Read on General."
}

When you get this API response ensure that under the API keys section your API Key has the correct permissions: API Keys

Error Response

{
    "status": false,
    "error": "API not authorised, please update list settings"
}

When you get this API response ensure that the list settings Enable API is checked: API Keys


Copyright © 2024 SwitchTransact