Skip to content

Instantly share code, notes, and snippets.

View vnktsf's full-sized avatar

Venkata Polavarapu vnktsf

View GitHub Profile
@douglascayers
douglascayers / PardotAPIQueryDemo.cls
Last active February 24, 2020 21:00
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 );