Generate chat
POST {{_baseUrl}}/models/:modelName/chat-generations
Request Body
{"messages"=>[{"role"=>"user", "content"=>"Can I use the Salesforce REST API to retrieve a record?"}, {"role"=>"assistant", "content"=>"Yes, you can use the Salesforce REST API to retrieve a record. The REST API provides a simple and efficient way to interact with Salesforce data using standard HTTP methods like GET, POST, PUT, and DELETE. To retrieve a record, you can use the GET method on the specific record's endpoint URL. Here's an example of how to retrieve a record using the REST API:\n\n1. Authenticate and obtain an access token.\n2. Construct the endpoint URL for the specific record you want to retrieve. The URL should follow the format: `https://instance.salesforce.com/services/data/vXX.X/sobjects/Object_Name/Record_Id`.\n - Replace `instance` with your Salesforce instance (e.g., `na1`).\n - Replace `XX.X` with the Salesforce API version you are using (e.g., `v52.0`).\n - Replace `Object_Name` with the API name of the object you want to retrieve a record from (e.g., `Account`).\n - Replace `Record_Id` with the ID of the specific record you want to retrieve.\n3. Make a GET request to the constructed endpoint URL, including the access token in the request headers.\n4. Parse the response to retrieve the record details.\n\nNote that you need to have the necessary permissions and access rights to retrieve records using the REST API."}, {"role"=>"user", "content"=>"Nice, show me an example with \"my-developer-edition\" as the domain, 61.0 as the API version and \"Contact\" as the object."}], "localization"=>{"defaultLocale"=>"en_US", "inputLocales"=>[{"locale"=>"en_US", "probability"=>0.8}], "expectedLocales"=>["en_US"]}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
x-sfdc-app-context | string | (Required) This value is reserved for future use. For now, specify EinsteinGPT . | |
x-client-feature-id | string | (Required) This value is reserved for future use. For now, specify ai-platform-models-connected-app . | |
Content-Type | string |