Premium Only Content

Inserting a New Prospect into Pardot using Salesforce Apex | DewWow's Salesforce Solutions
In this tutorial, our expert from DewWow walks you through the steps to insert a new prospect into Pardot from Salesforce using Apex. We dive deep into the Pardot API, highlighting key points in the documentation, and offering hands-on coding examples. Don't miss out on these valuable insights to optimize your Salesforce operations.
Timestamps:
00:18 - Introducing the Sample Code
00:22 - Importance of Pardot API Documentation
00:26 - Navigating Pardot's API Site
00:36 - Using the Prospects Object in Pardot
00:48 - Pardot's Example for Creating a Prospect
01:00 - Importance of the Business Unit in API Header
01:06 - Passing the Prospect in JSON Format
01:15 - Generating JSON in Apex
01:27 - Quick Tip: Using a Map of Strings in Apex
01:51 - Key Points: API Endpoint & POST Method
02:00 - Demonstrating the API Call in Action
02:10 - Viewing the Created Prospect's ID in Salesforce
02:16 - Wrapping up and Offering Code Snippet in Description
Remember to hit that "Like" button if you found this tutorial helpful and subscribe for more Salesforce solutions from DewWow! If you have any questions or need further clarifications on any topic, drop a comment below, and we'll do our best to assist you.
Documentation:
https://developer.salesforce.com/docs/marketing/pardot/guide/prospect-v5.html
Source Code:
HttpRequest req = new HttpRequest(); req.setEndpoint('callout:DewWow_Named_Credential/api/v5/objects/prospects?fields=id,email,firstName,lastName');
req.setMethod('POST');
req.setHeader('Content-Type', 'application/json');
req.setHeader('Pardot-Business-Unit-Id', '0UvHo000000005LKAQ');
// Create map of string string for the json payload
Map String, String jsonMap = new Map String, String();
jsonMap.put('email', 'a@sample.com');
jsonMap.put('firstName', 'Test');
jsonMap.put('lastName', 'User');
String jsonStr = JSON.serialize(jsonMap);
req.setBody(jsonStr);
// send the request
Http http = new Http();
HTTPResponse res = http.send(req);
// debug response code
System.debug('status: '+ res.getStatusCode());
System.debug(res.getBody());
-
33:50
The Why Files
8 days agoCryptids Vol. 3: The Antarctic Cover-up | Predators Beneath the Ice
43.7K54 -
27:11
Stephen Gardner
4 hours ago🔥Trump Zelensky Meeting ends in IMPEACHMENT | MUSK shares major dirt on Joe Rogan Podcast
20K120 -
LIVE
Jewels Jones Live ®
3 days agoTRUMPARENCY | A Political Rendezvous - Ep. 112
2,237 watching -
1:13:14
Michael Franzese
4 hours agoEmergency Livestream: Zelenskyy vs Trump, DOGE, Epstein Files, Elon Musk
49.6K33 -
1:32:06
The Quartering
5 hours agoZelensky Comes CRAWLING BACK, Fed Ex Jet BURSTS Into Flames, Elon's Psycho Ex & More
82.6K95 -
6:49
Russell Brand
1 day ago"HE'S A RUSSIAN PLANT!" CNN Loses It ON AIR!
143K174 -
13:10
The Rubin Report
1 day agoWhy the Real Challenge Is Just Beginning | Jordan Peterson
74.1K25 -
1:02:55
Tactical Advisor
6 hours agoBuilding a Truck Gun -Battle Hawk Build of the Month | Vault Room Live Stream 017
50K1 -
42:41
Athlete & Artist Show
5 hours ago $2.69 earnedSeason 5 Episode 3 LIVE
45K3 -
3:25:14
I_Came_With_Fire_Podcast
13 hours agoThe US GOVERNMENT is PLANNING a UAP FALSE FLAG ATTACK
30.5K11