How to include Related Object Fields in Salesforce Contact responses

Edited

Use pass-through parameters and custom mappings to include related object fields in contact responses without making separate API calls.

Overview

For related Salesforce fields (e.g., Account.Name, Account.Id), use:

  1. Pass-through to include the field in the SOQL query

  2. Custom mapping with a JSON path to extract the nested field

Step-by-Step Guide

Step 1: Create a Custom Mapping

  1. Go to your Apideck dashboard > Configuration

  2. Navigate to Custom Mappings

  3. Click on Create Mapping next to the Contacts resource under CRM

    1. Create a unique response key and name that links contact data fields from the API response to your own system’s attributes

    1. Once you've created the response key, click on it and this will allow you set the mapping for a specific connector

    1. Select Salesforce and Property Mapping from the list

    1. Go to Advanced and add $.Account.Id or $.Account.Name (use JSON path notation)

    Note: Related object fields won't appear in the dropdown under "Select". This is why you need to enter the JSON path manually in "Advanced".

  1. Save the mapping

Step 2: Use Pass-through in Your API Request

  • Include the related fields that you have set up previously in your pass-through parameters:

    URL Example: https://unify.apideck.com/crm/contacts?pass_through[fields]=Id,FirstName,LastName,Email,Account.Name, Account.Id

  • The response contains account_id and account_name

Custom Filtering with Related Fields