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', '[email protected]');
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
Akademiks
2 hours agoEBRO PETER ROSENDWEEB Fired! RIP BOZOS! Hip hop media in Shambles. DRAKE LAUGHING AT EM!
1,031 watching -
SpartakusLIVE
7 hours agoNEW Mode - AMPED || Grapple Hooks & BOOSTED Health
97.7K -
6:00:40
GrimmHollywood
8 hours ago🔴LIVE • GRIMM HOLLYWOOD • GRIMMBAS • DAY 0 of 12 • MAX PAYNE 3 JOHN WICK MOD • LAW at 6 PM EST •
31.7K3 -
2:10:16
TimcastIRL
9 hours agoNEW Epstein Photos Drop, Dems Cherry Pick Photos To Smear Trump | Timcast IRL
199K66 -
28:11
Stephen Gardner
9 hours agoTrump’s Genius Move REVEALED!!
24.8K84 -
LIVE
GritsGG
12 hours agoBO7 Warzone Is Here! Win Streaking! New Leaderboard?
653 watching -
Joker Effect
2 hours agoDRAMA NEWS INTERVIEW OF TYSON HOCKLEY! New era of content creation? Will he Box Clav? Networking 101
9.44K2 -
2:28:23
XDDX_HiTower
3 hours ago $2.47 earnedtactical pirate setting sail! lets find that booty! [RGMT CONTENT Mgr. | RGMT GL | GZW CL]
13.7K -
1:45:59
Glenn Greenwald
10 hours agoGlenn Answers Your Questions On: Looming AI Threats; Controversy Over "Pluribus," Epstein Revelations, CAIR's "Terrorist" Label, and More | SYSTEM UPDATE #558
116K32 -
LIVE
Eternal_Spartan
1 day ago🟢 Eternal Spartan Plays Valheim (Community Server) | USMC Veteran
190 watching