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());
-
1:02:11
DeVory Darkins
14 hours ago $39.22 earnedDemocrats suffers ANNIHILATION during heated hearing with Bondi as Jack Smith bombshell drops
165K111 -
57:17
Dialogue works
2 days ago $2.19 earnedAmb. Chas Freeman: Israel on the EDGE: Is TOTAL DEFEAT IMMINENT?!
31.9K12 -
14:06
Actual Justice Warrior
1 day agoSomali Medicaid SCAMMER Says Theft Is HIS CULTURE
16.2K22 -
10:27
itsSeanDaniel
2 days agoCBS Host INSTANTLY REGRETS Interrupting MAGA SuperStar
19.2K8 -
1:25:01
Coin Stories with Natalie Brunell
1 day agoThe Coming Currency War: Gold, Dollar, and Bitcoin with Matthew Pines
16K2 -
LIVE
GritsGG
20 hours ago36 Hour Marathon Stream! Most Wins in WORLD! 3704+!
1,507 watching -
15:10
Dr Disrespect
19 hours agoI FINALLY Beat Baby Steps
14.9K11 -
8:38
MattMorseTV
14 hours ago $6.32 earnedThis is CATASTROPHIC for the Dems.
21.9K14 -
19:54
Forrest Galante
2 days agoPrivate Tour Of America's Best Marine Animal Facility
77.8K9 -
2:59:11
Side Scrollers Podcast
20 hours agoDEI’s FINAL BOSS EXPOSED + Book Publisher REVERSES Cancel Attempt + More | Side Scrollers
59.1K19