Passthrough Fields
Passthrough fields allow you to pull in custom fields that you don't have defined yet in your resource schema. For example, you might want to pull in CRM contact data which commonly includes custom fields.
To enable passthrough fields, simply specify passthrough_fields: true
when initiating a session (POST api/session/initiate).
By default, when field_selection
is false, all available custom fields will be pulled in. When field_selection
is true, the user will be able to choose which custom fields to pull in.
To get the data format of the passthrough fields, you may either:
- Poll the GET api/session/configuration endpoint, which will successfully return once the user finishes configuring the session, or
- Setup the
configuration_webhook
when initiating a session (POST api/session/initiate).
In either case, the configuration data will be returned in the following format:
{
"success": true,
"session_id": "6566e85e7cf20dca9cef0c0a",
"endgrate": {
"provider": "hubspot",
"provider_info": {
"name": "hubspot",
"display_name": "HubSpot",
"url": "https://www.hubspot.com/",
"image": "https://endgrate.nyc3.cdn.digitaloceanspaces.com/integration/hubspot.png",
"auth_type": "oauth",
"specific": {},
"endgrate_provider_type": "CRM"
}
},
"schemas": {
"contact": {
"integration_info": {
"name": "get-contacts",
"display_name": "Get Contacts",
"method": "IMPORT"
},
"integration": "get-contacts",
"schema": {
"type": "object",
"associations": true,
"endgrate_type": "crm-contact",
"properties": {
"email": {
"type": "string",
"format": "email"
},
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"full_name": {
"type": "string"
},
"company": {
"type": "string"
},
"age": {
"type": "number"
},
"is_employed": {
"type": "boolean"
},
"lifecyclestage": {
"title": "Lifecycle Stage",
"type": "string"
}
},
"required": [
"email"
],
"title": "crm-contact",
"session_method": "IMPORT"
},
"passthrough_fields": {
"properties": {
"lifecyclestage": {
"title": "Lifecycle Stage",
"type": "string"
},
"required": []
}
}
}
},
"passthrough_schemas": {
"custom": {
"integration_info": {
"name": "get-custom-objects",
"display_name": "Get Custom Objects",
"method": "IMPORT"
},
"integration": "get-custom-objects",
"schema": {
"type": "object",
"associations": true,
"endgrate_type": "Custom",
"properties": null,
"required": [],
"title": "custom",
"session_method": "IMPORT"
},
"passthrough_fields": {
"customfield1": {
"type": "string"
},
"required": [
"customfield1"
]
}
}
}
}
The schemas
attribute is an object that contains schemas for the session keyed by the endgrate_type
. In each schema, the schema
is the JSON schema of the endgrate_type
(including passthrough fields), and the passthrough_fields
is the JSON schema of only the passthrough fields. In the above example, the custom field lifecyclestage
was passed-through.
Updated 8 months ago