Add this first. This tool needs an access token, so add Get Salesforce Access Token to the same bot. The bot calls it first and passes the token in.
What the model is told
Get a Salesforce access token first if you do not already have one. Find a contact in Salesforce by email address. Returns a records array (totalSize says how many) with the contact's record ID, name, email and phone number, or an empty records array if they do not exist.
Request
GEThttps://YOUR_INSTANCE.my.salesforce.com/services/data/v67.0/query?q=SELECT+Id,Name,Email,Phone+FROM+Contact+WHERE+Email=%27{{email}}%27+LIMIT+1
Headers
AuthorizationBearer {{accessToken}}
Parameters
email stringThe email address of the contact to find.accessToken stringThe access_token value returned by Get Salesforce Access Token. Reuse it for the rest of the conversation.
Engage payload
{
"source": "VOICE_AI",
"tool": {
"id": "1d9ffbd4-88dd-4edd-b352-3c505d5b482d",
"type": "HTTP_REQUEST",
"label": "Find Salesforce Contact",
"name": "find_salesforce_contact",
"customName": false,
"description": "Get a Salesforce access token first if you do not already have one. Find a contact in Salesforce by email address. Returns a records array (totalSize says how many) with the contact's record ID, name, email and phone number, or an empty records array if they do not exist.",
"parameters": [
{
"name": "email",
"type": "string",
"description": "The email address of the contact to find."
},
{
"name": "accessToken",
"type": "string",
"description": "The access_token value returned by Get Salesforce Access Token. Reuse it for the rest of the conversation."
}
],
"config": {
"endpoint": {
"method": "GET",
"url": "https://YOUR_INSTANCE.my.salesforce.com/services/data/v67.0/query?q=SELECT+Id,Name,Email,Phone+FROM+Contact+WHERE+Email=%27{{email}}%27+LIMIT+1"
},
"headers": [
{
"name": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"body": null,
"timeout": null
}
}
}IDs are regenerated on every copy.