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. Create a lead for someone interested in buying. Confirm their name, company, email and phone with them first. Company is required by Salesforce, so use their employer or the word Individual if they have none. Returns the new lead ID in the id field, with success set to true.
Request
POSThttps://YOUR_INSTANCE.my.salesforce.com/services/data/v67.0/sobjects/Lead
Headers
Content-Typeapplication/jsonAuthorizationBearer {{accessToken}}
Body
{
"FirstName": "{{firstName}}",
"LastName": "{{lastName}}",
"Company": "{{company}}",
"Email": "{{email}}",
"Phone": "{{phone}}",
"LeadSource": "Phone Inquiry"
}Parameters
firstName stringThe lead's first name.lastName stringThe lead's last name.company stringThe lead's company, or Individual.email stringThe lead's email address.phone stringThe lead's phone number.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": "ba7a2e23-bb1d-4611-9552-df554b749ffa",
"type": "HTTP_REQUEST",
"label": "Create Salesforce Lead",
"name": "create_salesforce_lead",
"customName": false,
"description": "Get a Salesforce access token first if you do not already have one. Create a lead for someone interested in buying. Confirm their name, company, email and phone with them first. Company is required by Salesforce, so use their employer or the word Individual if they have none. Returns the new lead ID in the id field, with success set to true.",
"parameters": [
{
"name": "firstName",
"type": "string",
"description": "The lead's first name."
},
{
"name": "lastName",
"type": "string",
"description": "The lead's last name."
},
{
"name": "company",
"type": "string",
"description": "The lead's company, or Individual."
},
{
"name": "email",
"type": "string",
"description": "The lead's email address."
},
{
"name": "phone",
"type": "string",
"description": "The lead's phone number."
},
{
"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": "POST",
"url": "https://YOUR_INSTANCE.my.salesforce.com/services/data/v67.0/sobjects/Lead"
},
"headers": [
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"body": "{\n \"FirstName\": \"{{firstName}}\",\n \"LastName\": \"{{lastName}}\",\n \"Company\": \"{{company}}\",\n \"Email\": \"{{email}}\",\n \"Phone\": \"{{phone}}\",\n \"LeadSource\": \"Phone Inquiry\"\n}",
"timeout": null
}
}
}IDs are regenerated on every copy.