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
The Rubin Report
19 minutes ago‘The View’ Goes Viral as Hosts Have a Historic Meltdown Live on the Air
739 watching -
LIVE
Steven Crowder
1 hour ago🔴 How & Why Trump Won the Presidency | We Have the Facts
90,862 watching -
LIVE
Benny Johnson
47 minutes ago🚨 Joe Biden SURRENDERS To Trump LIVE Right Now At WhIte House After LANDSLIDE Victory, Pelosi CRIES
9,211 watching -
UPCOMING
LFA TV
12 hours agoIT'S TIME FOR AN OVERHAUL! | LIVE FROM AMERICA 11.7.24 11am EST
2.92K -
14:40
Rethinking the Dollar
1 hour agoCan Trump's Policies Survive This Economic Tsunami?
180 -
LIVE
Wendy Bell Radio
6 hours agoThe Adults Are Back
14,846 watching -
LIVE
The Kirk Minihane Show
2 hours agoKMS LIVE | November 7, 2024 - ft. Blind Mike & Mama K
991 watching -
LIVE
Matt Kohrs
10 hours agoFOMC Day, New Market Highs & Election Meltdown || The MK Show
1,604 watching -
Graham Allen
2 hours agoKamala FINALLY Concedes While Jack Smith And DOJ DROP Hoax Cases AGAINST Trump!!
53.8K -
31:45
BonginoReport
4 hours agoLeft-wing Women are in Meltdown Mode (Ep.80) - 11/07/24
81.4K192