Setting Up Apex to Call Pardot Prospects in Salesforce: A Step-by-Step Guide

1 year ago
3

Welcome to DewWow's tutorial on Salesforce integration! In this video, our Salesforce consultant walks you through the process of using Apex to call Pardot for retrieving a list of prospects. Dive deep into setting up named credentials, business unit IDs, creating connected apps, and more. Whether you're a newbie trying to understand the basics or an expert looking for a refresher, this tutorial is tailored to help you seamlessly integrate Pardot with Salesforce using Apex. Discover the nuances of authentication, authorization, and setting up named credentials. By the end, you'll have a clear roadmap to enhance your Salesforce operations. If you find value in this tutorial or have suggestions for improvements, we'd love to hear from you. Don't forget to subscribe to DewWow for more Salesforce insights!

HttpRequest req = new HttpRequest();
req.setEndpoint('callout:YOUR-NAMEDCRED/api/v5/objects/prospects?fields=id,email,firstName');
req.setMethod('GET');
req.setHeader('Content-Type', 'application/json');
req.setHeader('Pardot-Business-Unit-Id', 'YOUR-BUID');

// send the request
System.debug('Calling Pardot');
Http http = new Http();
HTTPResponse res = http.send(req);

// debug response code
System.debug('status: '+ res.getStatusCode());
System.debug(res.getBody());

Loading comments...