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());
-
1:29:23
Nerdrotic
3 hours ago $2.70 earnedThe Turning Point | New UFO Video with Michael Collins | Forbidden Frontier #117
17.6K2 -
LIVE
Sarah Westall
1 hour agoSuicide Pacts forming in Youth Social Media Groups - Discord, Reddit, TikTok w/ John Anthony
403 watching -
2:25:31
vivafrei
11 hours agoEp. 281: Charlie Kirk; Routh Trial; Charlotte Train; Bolsanaro Defense; SCOTUS & MORE!
72.5K81 -
Turning Point USA
2 hours agoWASHINGTON D.C. PRAYER VIGIL FOR CHARLIE KIRK
24.8K11 -
The Mel K Show
2 hours agoMel K & Tim James | Healing is an Inside Job | 9-14-25
6.07K1 -
LIVE
IsaiahLCarter
5 hours agoCharlie Kirk, American Martyr (with Mikale Olson) || APOSTATE RADIO 028
171 watching -
16:43
Mrgunsngear
9 hours ago $0.80 earnedKimber 2K11 Pro Review 🇺🇸
2.77K9 -
13:40
Michael Button
1 day ago $0.17 earnedThe Strangest Theory of Human Evolution
4484 -
10:19
Blackstone Griddles
1 day agoMahi-Mahi Fish Tacos on the Blackstone Griddle
8711 -
23:51
Jasmin Laine
1 day ago“Stop Wasting My Time!”—Trump's BRUTAL WARNING To Canada As Poilievre ROASTS CBC LIVE
1.74K15