Skip to content

Instantly share code, notes, and snippets.

View vnktsf's full-sized avatar

Venkata Polavarapu vnktsf

View GitHub Profile
@vnktsf
vnktsf / PardotAPIQueryDemo.cls
Created February 7, 2020 16:47 — forked from douglascayers/PardotAPIQueryDemo.cls
Sample Apex HTTP Callout to Pardot API http://developer.pardot.com/
String email = '<pardot email/username>';
String password = '<pardot password>';
String userKey = '<pardot user key>';
HttpRequest req = new HttpRequest();
req.setEndpoint( 'https://pi.pardot.com/api/login/version/4' );
req.setMethod( 'POST' );
req.setBody( 'email=' + email + '&password=' + password + '$&user_key=' + userKey );
HttpResponse res = new Http().send( req );