api.v2.contacts module

api.v2.contacts.add_contact_to_role(contact_id=None, role_name=None)[source]

Adds a specified contact to the given role.

Parameters:
  • contact_id (str) – UUID of the contact
  • role_name (str) – Name of the role of which to associate the contact
Returns:

  • success (bool) – Whether or not the role could appropriately be applied to the contact

  • messages (list) – List of human-readable error messages

  • data (dict) – Object with the following format.

    {
        "contact_id": "",
        "role_id": "",
        "role_name": ""
    }
    

api.v2.contacts.add_member_to_agency(member_id=None, agency_id=None)[source]
Parameters:
  • member_id (str) – contact id of Agent
  • agency_id (str) – contact id of Agency
Returns:

  • success (bool) – True if successful, false if not
  • messages (str) – specifying the appropriate status

api.v2.contacts.create_credit_report_for_contact(contact_id=None)[source]

Get the current credit report for a given contact

Returns:
  • data (A dictionary with credit report, if successfully created)
  • : – {
    ‘id’: UUID, ‘contact_id’: UUID, ‘content’: str, ‘date_added’: date, ‘report_number’: str, ‘score’: str, ‘error’: str, ‘vendor_id’: UUID

    }

  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
api.v2.contacts.credit_score_threshold_details(contact_ids=[], ref_contact_id=None)[source]

Get the credit score threshold data on contacts that have existing credit reports

Parameters:
  • contact_ids (list) – Contacts to validate credit score reports on.
  • ref_contact_id (UUID) – The associate contact assigned with a limited score allowed
Returns:

  • success (bool) – True if successful, false if not

  • messages (list of str:) – List of human-readable error messages

  • data (dict) – Object with threshold information

    {
        "success" : bool
            True if all the given contacts pass the threshold
        "warnings": list
            A list of dictionaries consisting of `message` and `contact_id`
            [{
                "message" : str
                    Failure message
                "contact_id" : uuid
                    Contact ID
            }]
    }
    

api.v2.contacts.find_contact_by_params(name=None, role_name=None, dob=None)[source]

Find insured using given params

Parameters:
  • name (str) – Contact name (full or partial)
  • role_name (str) – One of contact’s roles (optional param, if None passed - won’t filter)
  • dob (str) – Contact’s DOB. Format is mm/dd/yyyy (optional param, if None passed - won’t filter)
Returns:

  • success (bool) – True if successful, false if not

  • messages (list of str) – List of human-readable error messages

  • data (list of dict) – List of contacts that meet search criteria

    [{
        "ssn_exist": true,
        "name": "John Doe",
        "roles": [
            "Insured Portal User",
            "Named Insured"
        ],
        "phones": [
            {
                "date_updated": "2018-10-08 02:35:57",
                "phone": "(111) 111-1111",
                "type": "Home",
                "id": "14aef33b-9fff-4b27-b139-d8d9dcd93c07",
                "contact_id": "02a40e00-c72c-4fef-be3c-c46bc71910df"
            }
        ],
        "emails": [
            {
                "date_updated": "2018-10-04 03:09:41",
                "type": "Home",
                "id": "da79df01-0bf1-464a-8a1c-61226823ca12",
                "contact_id": "02a40e00-c72c-4fef-be3c-c46bc71910df",
                "email": "a@a.com"
            }
        ],
        "id": "02a40e00-c72c-4fef-be3c-c46bc71910df"
    }]
    

api.v2.contacts.get_contact(contact_id=None)[source]

Retrieve contact_id by id.

Parameters:contact_id (str) – Contact id
Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (dict containing contact)
api.v2.contacts.get_contact_by_credentials(username, password)[source]

Returns contact data of which credentials are passed.

Parameters:
  • username (str) – Required. The username of the contact to be migrated.
  • password (str) – Required. The password of the contact to be migrated.
Returns:

  • success (bool) – Whether or not the contact was found and could be authenticated with the given credentials.

  • messages (list of str) – List of human-readable error messages.

  • data (dict) – An object of the following format.

    {
        'contactId': '',
        'name': '',
        'confirmationEmail': '',
        'phoneNumber': '', # (the first phone number from the contact)
        'roles': [''], # (only the roles' names)
        'timezone': '',
        'photoId': ''
    }
    

api.v2.contacts.get_contacts_by_ids(contact_id_list=None)[source]

Retrieve contacts by id.

Parameters:contact_id_list (list of str) – Contact ids
Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (dict containing contacts)
api.v2.contacts.get_payment_methods(payment_method_ids=None)[source]

Retrieve payment methods by id.

Parameters:payment_method_ids (list of str) – Payment method ids
Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (dict containing payment methods)

Links the given contact to the Cognito username specified in the request.

Parameters:
  • contact_id (str) – Required. ID of the contact to be linked.
  • cognito_username (str) – Required. Cognito username to which contact will to be linked.
Returns:

  • success (bool) – Whether or not the contact could be linked.
  • messages (list of str) – List of human-readable error messages.

api.v2.contacts.list_credit_reports_for_contact(contact_id=None)[source]

List credit reports available for the given contact

Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (list of dict) – A list of dictionary entries, of the following format:
    {
        'id': UUID,
        'name': score,  # score value
        'date': str,  # (representation of a date MM-DD-YYYY),
    }
    
api.v2.contacts.list_emails_for_contact(contact_id=None)[source]

List emails available for the given contact

Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (list of dict) – A list of dictionary entries, of the following format:
    {
        'id': UUID,
        'email': str,
        'type': str,  # Home, Work, Other
    }
    
api.v2.contacts.new_contact(name=None, doing_business_as=None, type='individual', date_of_birth=None, ssn=None, fein_tax=None, legal_entity_type=None, date_business_started=None, phones=None, emails=None, addresses=None, cognito_username=None, is_god=False, roles=None, username=None, confirmation_email=None)[source]

Creates a new Contact record and optionally related phones/emails/addresses.

Parameters:
  • name (str) – Required. The full name of the contact.
  • doing_buiness_as (str) –
  • type (str) – Either ‘individual’ or ‘organization’. Defaults to ‘individual’.
  • date_of_birth (str) – Date-string, typically in YYYY-MM-DD format (encrypted within BriteCore).
  • ssn (str) – The raw SSN of the contact (encrypted within BriteCore).
  • fein_tax (str) –
  • legal_entity_type (str) –
  • date_business_started (str) – Date-string, typically in YYYY-MM-DD format.
  • phones (list) –

    List of JSON objects with phone details

    {
        "phone": "1-111-1111",
        "type": "Work"
    }
    
  • emails (list) –

    List of JSON objects with email details

    {
        "email": "person@domain.com",
        "type": "Home"
    }
    
  • addresses (list) –

    List of JSON objects with address details.

    {
        "address_line1": "123 Main",
        "address_city": "Springfield",
        "address_state": "MO",
        "address_zip": "12345",
        "address_country": "USA",
        "address_city_other": "",  # Use if `address_country` is outside of U.S.A.
        "address_county_other": "",  # Use if `address_country` is outside of U.S.A.
        "address_state_other": "",  # Use if `address_country` is outside of U.S.A.
        "type": "Mailing/Billing"
    }
    
  • cognito_username (str) – Cognito username associated with this contact.
  • is_god (bool) – Whether contact is isGod or not. Defaults to ‘False’. (Note: Only isGod users can set this to ‘True’)
  • roles (list) – List of roles that contact has.
  • username (str) – The username of the contact.
  • confirmation_email (str) – The unique email used for log in.
Returns:

  • success (bool) – Whether or not the contact could be created.

  • messages (list of str) – List of human-readable error messages.

  • data (dict) – An object of the following format.

    {
        'contact_id': '',
        'addresses': [
            {
                'id': '',
                'address_line1': '',
                'address_city': '',
                'address_state': '',
                'address_zip': '',
                'address_county': '',
                'address_country': '',
                'type': '',
            }
        ],
        'phones': [
            {
                'id': '',
                'phone': '',
                'type': ''
            }
        ],
        'emails': [
            {
                'id': '',
                'email': '',
                'type': ''
            }
        ]
    }
    

api.v2.contacts.remove_contact_information(contact_id=None, contact_addresses=None, contact_phones=None, contact_emails=None)[source]

Verifies ‘contact_id’ with ‘contact_id’ key in each object, if contact is the owner of the object, it will be removed.

Parameters:
  • contact_id (str) –
  • contact_addresses

    ‘contact_id’ : str ... },

  • ]
  • contact_phones

    ‘contact_id’ : str ... },

  • ]
  • contact_emails

    ‘contact_id’ : str ... },

  • ]
api.v2.contacts.retrieveAddressInfo(zip=None, addressLine1=None, stateAbbr=None)[source]

Retrieve Address Info Retrieves the address information for a given location.

Parameters:
  • zip (str) – A US zipcode
  • address_line_1 (str) – The address to search for
  • state (str) – The state.
Returns:

  • cities (list of str) – A list of cities.
  • counties (list of str) – A list of counties
  • lat (str) – Latitude
  • lng (str) – Longitude

api.v2.contacts.retrieve_agencies_near_zip(zipcode=None, results=10, max_distance=50)[source]

Returns nearest [results] contacts that have Agency role to the provided zipcode. Useful for website “agency locator” function. :param zipcode: :type zipcode: str/int - 5-digit zipcode to search near :param results: :type results: int - number of results to provide, capped at 20 to prevent scraping :param max_distance: :type max_distance: int - max number of mile radius to return results within

Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (list) – List of found agencies. Each agency record is a dict with keys:
    name, latitude, longitude, distance (miles), website, addressLine1, addressLine2, city, state, zip, telephone, fax
api.v2.contacts.retrieve_all_roles()[source]

Returns a list of all the roles in the database.

Returns:
  • success (bool) – Whether request was processed successfully.
  • data (list) – List of Role objects.
api.v2.contacts.retrieve_contact_motor_vehicle_reports(contact_id=None, store_no_hit=False)[source]

Gives out a list of all incidents count from the respective MVR reports.

Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (list of dict) – A list of dictionary entries, of the following format:
    {
        <contact id>: [{"accidents_count": 0, "violations_count": 1},
        ..]
    
    }
    
api.v2.contacts.retrieve_credit_score_tier(contact_id=None)[source]

Get the credit score tier for a given contact

Returns:
  • data (A dictionary)
  • : – {
    ‘credit_tier’: str

    }

  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
api.v2.contacts.update_contact(contact=None)[source]

Updates an existing contact.

Parameters:contact (dict) –

A dictionary with contact info

{
    'id': UUID,
    'name': str,
    'dob': str,  # (representation of a date, either YYYY-MM-DD or MM/DD/YYYY),
    'ssn': str,
    'fein_tax': str,
    'legal_entity_type': str,
    'date_business_started': str,
    'risk_id_number': str,
    'dba': str,
    'purchase_date': str,
    'website': str,
    'addresses': [
        {
            'id': UUID,  # optional if adding a new address
            'type': ('Mailing/Billing', 'Mailing', 'Billing', 'Other'),
            'type_label': str,  # only if type == 'Other'
            'address_line1': str,
            'address_line2': str,  # optional
            'address_city': str,
            'address_state': str,
            'address_zip': str,
            'address_county': str,
            'address_country': ('USA', 'Canada', 'Other')  # defaults to 'USA'
        }
    ],
    'emails': [
        {
            'id': UUID,  # optional if adding a new email address
            'email': str,
            'type': ('Work', 'Personal', 'Other')
        }
    ],
    'phones': [
        {
            'id': UUID,  # optional if adding a new phone number
            'phone': str,
            'type': ('Cell', 'Home', 'Work', 'Fax')
        }
    ],
}

Note

Besides the UUIDs, if any key is empty, we assume you want to clear it. If you do not want to clear a field, leave the key out of your request. In other words, every key/value pair you send will be checked for discrepencies with the current data, and changes will be made.

Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (dict) – Echoes the updated information, complete with any other addresses/emails/phones
api.v2.contacts.update_contacts(contacts=None)[source]

Batch update contacts. See update_contact for details for each update. :param contacts: :type contacts: list of dicts - each dict should follow the update_contact schema

Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
api.v2.contacts.validate_last_4_ssn_digits(contact_id=None, last_4_ssn_digits=None)[source]

Find insured using given params

Parameters:
  • contact_id (str) – Contact id
  • last_4_ssn_digits (str) – Last 4 ssn digits. Note that if user’s SSN in DB is None - result will be “false”
Returns:

  • success (bool) – True if validated, false if not
  • messages (list of str) – List of human-readable error messages