Integrating Salesforce with Chad GPT

Integrating Salesforce with Chad GPT

Hello everyone. In today’s session, we will be discussing the integration of Salesforce with Chad GPT. Firstly, let’s start with a small demo of the component that I have created. You can ask any question to Chad GPT, for example, about working in Salesforce. Click on ‘Ask’ and in the backend, it is using the GPT API to fetch and display the response.

Chad GPT is a cloud-based customer relationship management platform that helps with business management, sales, marketing, and investment services.

To integrate Salesforce with Chad GPT, you need to obtain the API keys from OpenAI, the company that launched GPT. Login to api.openai.com, go to your personal area, and click on ‘New API Keys’. Copy the secret key and save it. Then, in Salesforce, create a named credential and use the secret key as the bearer. Set the URL to the GPT endpoint.

Next, create an LWC component with a text area and a button. In the JS controller, call the Apex controller to get the response from the GPT API. Display the response on the component.

The Apex controller queries the details from the metadata and constructs the API request. It sets the model as GPT 5.3.5-turbo and the role as user. Once you hit the API, you get a successful response, which is parsed and returned to the lightning component.

That’s it! Now you can integrate Salesforce with Chad GPT and enjoy asking questions. If you have any questions or need further assistance, feel free to reach out to me. I will also provide a blog post with the code for reference. Thank you and have a great day!

The Magnificent Willow Tree
Older post

The Magnificent Willow Tree

Newer post

Exploring Code Interpreter: Adding Watermarks to Images

Exploring Code Interpreter: Adding Watermarks to Images