Relationship Intelligence
Relationship Intelligence

Relationship Intelligence

The Relationship Intelligence (RI) import API (/api/rest/v4/ri/import/...) lets you push email and meeting interactions into DealCloud for scoring workflows. Published SDK helpers match the v4 swagger: emails, meetings, status, and settings only—do not assume extra analytics paths unless your tenant documents them.

HTTP is via intapp-rest-client. See the upstream Relationship Intelligence API (opens in a new tab) documentation.

⚠️

import_emails / import_meetings return HTTP 200 with an array of RiMailboxResponseVm rows. Failures are often indicated per row (status, errors, warnings), not via HTTP 4xx. Inspect each row or use ri_mailbox_response_failed / ri_mailbox_responses_all_succeeded from dealcloud_sdk.relationshipintelligence.dealcloud_ri.

import_emails() / import_email()

Bulk import expects Swagger-shaped RiEmailMailboxVm dicts:

from dealcloud_sdk import DealCloud, DealCloudConfig
from datetime import datetime
 
config = DealCloudConfig(
    siteUrl="yoursite.dealcloud.com",
    clientId=12345,
    clientSecret="your-secret",
)
dc = DealCloud.from_config_object(config)
 
mailboxes = [
    {
        "userId": 101,
        "handlerType": 1,
        "emails": [
            {
                "uniqueId": "msg-001",
                "sentDate": datetime.now().isoformat(),
                "sender": {"address": "a@example.com", "name": "A"},
                "recipientsTo": [{"address": "b@example.com"}],
            }
        ],
    }
]
 
rows = dc.import_emails(mailboxes)

Convenience for a single message:

rows = dc.import_email(
    user_id=101,
    handler_type=1,
    unique_id="msg-002",
    sent_date=datetime.now(),
    sender_address="a@example.com",
    recipients_to=["b@example.com"],
)

import_meetings() / import_meeting()

rows = dc.import_meeting(
    user_id=101,
    unique_id="mtg-001",
    start_date=datetime.now(),
    organizer_address="org@example.com",
    required_attendees=["a@example.com", "b@example.com"],
)

get_processing_status()

status_rows = dc.get_processing_status(user_ids=[101, 102])

get_settings()

settings = dc.get_settings()
# e.g. historicalPeriodInMonths, syncLevel, isEmailCollectionEnabled, ...

Checking responses

from dealcloud_sdk.relationshipintelligence.dealcloud_ri import (
    ri_mailbox_responses_all_succeeded,
    ri_mailbox_response_failed,
)
 
rows = dc.import_emails(mailboxes)
assert ri_mailbox_responses_all_succeeded(rows)
# or
for row in rows:
    if ri_mailbox_response_failed(row):
        print(row)

Related