To invoke the Salesforce Prompt Templates using REST API, we have to make use of Salesforce Connect API.
Sample Salesforce Prompt Template:
Prompt Template Instruction Used:
Your role is to parse the {!$Input:strRequest} and extract the first name, last name and email. The extracted information should be returned in JSON Format with firstName, lastName and emailAddress.
Syntax:
https://{Your Domain URL}/einstein/prompt-templates/promptTemplateDevName/generations
Sample API Request
Sample Request Body Used:
{
"isPreview": "false",
"inputParams": {
"valueMap": {
"Input:strRequest": {
"value": "Admin User, [email protected]"
}
}
},
"additionalConfig": {
"applicationName": "PromptBuilderPreview"
}
}
Developer Article: