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());
-
LIVE
Dr Disrespect
1 hour ago🔴LIVE - DR DISRESPECT - ARENA BREAKOUT: INFINITE - ESCAPE OR LOSE EVERYTHING!
726 watching -
LIVE
The Shannon Joy Show
1 hour agoFinal Betrayal: Trump’s FBI Director Kash Patel Declares Jeffrey Epstein WASN’T A Sex Trafficker.
470 watching -
LIVE
The Mel K Show
1 hour agoMORNINGS WITH MEL K - Who Benefits? Order Out of Chaos & the Hegelian Dialectic 9-17-25
463 watching -
LIVE
Grant Stinchfield
59 minutes agoBombshell Audio Proves FBI Targeted Navarro for One Reason—Politics
124 watching -
LIVE
LFA TV
6 hours agoLFA TV ALL DAY STREAM - WEDNESDAY 9/17/25
4,530 watching -
1:02:21
VINCE
3 hours agoThe Left's Lawfare Onslaught REVEALED | Episode 127 - 09/17/25
180K152 -
59:53
The Rubin Report
1 hour agoCNN Reporter Humiliated as Question for Ted Cruz Blew Up in Her Face
15K13 -
1:31:19
Nikko Ortiz
2 hours agoLIVE - Alleged Charlie Kirk Assassin UPDATE
16K5 -
LIVE
Benny Johnson
2 hours agoKash Patel Testifying LIVE Now on Charlie Kirk Murder, Assassin 'STAGED' Texts With Trans Boyfriend?
6,524 watching -
LIVE
Caleb Hammer
4 hours agoThis Has Never Happened Before | Financial Audit
103 watching