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
SavageJayGatsby
2 hours ago🔥 Spicy Saturday with Friends 🔥
288 watching -
LIVE
GamerGril
3 hours agoDomestic Violence Simulator 💕Resident Evil 7💕
341 watching -
21:52
marcushouse
11 hours ago $2.17 earnedSpaceX’s New Starship Super Heavy Is… Kind of Mind Blowing! 🤯
5.68K3 -
24:09
MYLUNCHBREAK CHANNEL PAGE
1 day agoThe Field Museum is From Another Timeline: 2
94.9K24 -
LIVE
GritsGG
4 hours ago#1 Warzone Victory Leaderboard! 203+ Ws !
417 watching -
36:37
TampaAerialMedia
11 hours ago $0.33 earnedST AUGUSTINE | Florida's First Coast - The Beaches, Old Town, & Night of Lights
2.19K2 -
LIVE
iCkEdMeL
5 hours ago $69.39 earned🔴 BREAKING: Active Shooter 20 SHOT!! Reported at Brown University — Police Request Mass Rescues
2,472 watching -
2:51
Memology 101
1 day ago $0.46 earnedTop EU official says the way to stop ILLEGAL migration is to make EVERYONE asking for a job LEGAL
3.26K12 -
4:04:00
FrizzleMcDizzle
5 hours ago $1.63 earnedNEW VIDEO OUT NOW - A little NightReign for now
14.9K1 -
1:08:51
Jeff Ahern
6 hours ago $2.65 earnedThe Saturday Show with Jeff Ahern
24.7K3