Skip to main content

CRM Recommendation Rules

Recommendation rules define which assets are recommended to your sales reps based on CRM context. Administrators create rules that link Showpad content tags with CRM field values. When conditions match, relevant content surfaces as recommendations.

What you'll learn

  • How to create and manage CRM recommendation rules
  • How to link Showpad tags with CRM field values
  • How to use operators to define matching conditions

When to use the API

Contextual
Recommendations
Bulk Rule
Management
CRM
Sync
Custom
Integrations
Surface relevant content based on opportunity stage, industry, or other CRM fields.Programmatically create or update rules across your organization.Keep recommendation rules in sync with CRM configuration changes.Build recommendation logic into your own sales tools.
Prerequisites
  • Plan: Ultimate | Advanced or Expert
  • Permissions: Administrator access to Showpad's Admin App
  • Authentication: Valid OAuth 2.0 access token (learn more)
  • Config: A Salesforce instance integrated with Showpad

How Rules Work

Recommendation rules link Showpad content tags with CRM field values. When conditions in a rule are met, content with the designated tag is displayed as recommendations.

Example

When a sales rep works with a Lead in the Energy sector of the Industry field in Salesforce, assets with the Power2023 tag are recommended.

{
"conditions": [
{
"items": [
{
"fieldName": "Industry",
"objectName": "Lead",
"operator": "equals",
"value": "Energy"
}
]
}
],
"tags": {
"all": ["ba16a6afc2d4247862c9986aa09772fd"]
}
}

In this example, ba16a6afc2d4247862c9986aa09772fd is the tag ID for "Power2023".

Managing Rules

You can manage your Recommendation Rules for Salesforce in the Showpad Admin App. This Help Center article provides all the details.

Base Endpoint

Every request must be prefixed with the base endpoint:

https://{{subdomain}}.api.showpad.com/v4

CRM Recommendation Rules use Showpad API v4. Your calls use the base endpoint + the resource path:

https://{{subdomain}}.api.showpad.com/v4/crm/recommendations/rules

CRM Instance ID

The crmInstanceId is used to identify the Salesforce instance you've integrated with Showpad. You can get your instance identifier by viewing the Details in the Integrations > CRM section of the Showpad Admin App:

crmInstanceID

Request Body

The database definitions described in the table below are used to specify the conditions that must be met within your CRM for the following request types:

ItemData TypeDescription
objectNamestringThe main object type.
childObjectNamestringoptional

A subordinate of the main object.
fieldNamestringA specific field within the main or child object.
operatorstringHow the fieldName and the value are evaluated.

Available values:

  • equals
  • equalnot
  • contains
  • containsnot
  • startswith
  • startswithnot
  • endswith
  • endswithnot
valuestringThis specific information you want to work with.

Tags

You can refine your requests by specifying Showpad tags to specify that the rule only applies to assets with the designated tag(s).

Three options are available for defining how to match assets with the tags:

  • all - An asset must contain every one of the tags listed.

  • any - An asset must contain at least one of the tags listed.

  • none - An asset must not contain any of the tags listed.

Create Rule

Create a recommendation rule:

MethodEndpointDescription
POST/crm/recommendations/rulesCreates a CRM recommendation rule.

Example

This rule recommends assets tagged "big_bone" when a sales rep works with an Opportunity where chewToys equals "bigBone".

curl -X POST "https://{{subdomain}}.api.showpad.com/v4/crm/recommendations/rules" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"crmInstanceId": "5708b5480060c466a05c98522472df32",
"conditions": [
{
"items": [
{
"objectName": "opportunity",
"childObjectName": "dogToys",
"fieldName": "chewToys",
"operator": "equals",
"value": "bigBone"
}
]
}
],
"tags": {
"all": ["big_bone"],
"any": [],
"none": []
}
}'

Example Response

{
"id": "01H9TERHN6Z0AHENMV14K5YKPR",
"crmInstanceId": "5708b5480060c466a05c98522472df32",
"conditions": [
{
"items": [
{
"objectName": "opportunity",
"childObjectName": "dogToys",
"fieldName": "chewToys",
"operator": "equals",
"value": "bigBone"
}
]
}
],
"tags": {
"all": ["big_bone"],
"any": [],
"none": []
},
"createdAt": "2023-09-08T13:12:36.000Z",
"updatedAt": "2023-09-08T13:12:36.000Z"
}

Retrieve Rules

Specific CRM Instance

Retrieve all recommendation rules for a Salesforce instance:

MethodEndpointDescription
GET/crm/recommendations/rulesReturns all CRM recommendation rules for the specified CRM instance.

Example

curl "https://{{subdomain}}.api.showpad.com/v4/crm/recommendations/rules?crmInstanceId=5708b5480060c466a05c98522472df32" \
-H "Authorization: Bearer {access_token}"

Example Response

{
"count": 2,
"items": [
{
"id": "01H9FK4CRME24PVVNM1JR8T1ZE",
"crmInstanceId": "5708b5480060c466a05c98522472df32",
"conditions": [
{
"items": [
{
"objectName": "opportunity",
"childObjectName": "dogToys",
"fieldName": "chewToys",
"value": "bigBone",
"operator": "equals"
}
]
}
],
"tags": {
"all": [],
"any": ["951aca1a3576e1d1488f29e74756ee60"],
"none": []
},
"createdAt": "2023-09-04T07:57:20.000Z",
"updatedAt": "2023-09-05T07:29:41.000Z"
}
]
}

Specific Rule ID

Retrieve a single recommendation rule by ID:

MethodEndpointDescription
GET/crm/recommendations/rules/{ruleId}Returns the recommendation rule for the specified identifier.

Example

curl "https://{{subdomain}}.api.showpad.com/v4/crm/recommendations/rules/01H9TERHN6Z0AHENMV14K5YKPR" \
-H "Authorization: Bearer {access_token}"

Example Response

{
"id": "01H9TERHN6Z0AHENMV14K5YKPR",
"crmInstanceId": "5708b5480060c466a05c98522472df32",
"conditions": [
{
"items": [
{
"objectName": "lead",
"childObjectName": "dog_food",
"fieldName": "k9",
"operator": "contains",
"value": "kibble"
}
]
}
],
"tags": {
"all": ["beef"],
"any": [],
"none": []
},
"createdAt": "2023-09-08T13:12:36.000Z",
"updatedAt": "2023-09-08T13:12:36.000Z"
}

Update Rule

Update a recommendation rule:

MethodEndpointDescription
PUT/crm/recommendations/rules/{ruleId}Modifies the recommendation rule with the specified identifier.

Example

curl -X PUT "https://{{subdomain}}.api.showpad.com/v4/crm/recommendations/rules/01H9TERHN6Z0AHENMV14K5YKPR" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"id": "01H9TERHN6Z0AHENMV14K5YKPR",
"crmInstanceId": "5708b5480060c466a05c98522472df32",
"conditions": [
{
"items": [
{
"objectName": "lead",
"childObjectName": "dog_food",
"fieldName": "k9",
"operator": "contains",
"value": "kibble"
}
]
}
],
"tags": {
"all": ["chicken"],
"any": [],
"none": []
}
}'

Example Response

{
"id": "01H9TERHN6Z0AHENMV14K5YKPR",
"crmInstanceId": "5708b5480060c466a05c98522472df32",
"conditions": [
{
"items": [
{
"objectName": "lead",
"childObjectName": "dog_food",
"fieldName": "k9",
"operator": "contains",
"value": "kibble"
}
]
}
],
"tags": {
"all": ["chicken"],
"any": [],
"none": []
},
"createdAt": "2023-09-08T13:12:36.000Z",
"updatedAt": "2023-09-08T13:18:26.000Z"
}

Delete Rule

Delete a recommendation rule:

MethodEndpointDescription
DELETE/crm/recommendations/rules/{ruleId}Permanently removes the recommendation rule with the specified identifier.

Example

curl -X DELETE "https://{{subdomain}}.api.showpad.com/v4/crm/recommendations/rules/01H9TERHN6Z0AHENMV14K5YKPR" \
-H "Authorization: Bearer {access_token}"

Next steps

Was this page helpful?