@@ -17,9 +17,9 @@ the [authetication documentation on developer.pardot.com](https://developer.pard
17
17
access_token = '<access_token>' # Retrieve an access token from Salesforce using OAuth
18
18
business_unit_id = '<business_unit_id>' # Specify the Business Unit ID of the account to access
19
19
client = Pardot::Client.new nil, nil, nil, version, access_token, business_unit_id
20
-
20
+
21
21
Usage of the username, password, and API key authentication is deprecated and will be removed in an upcoming release.
22
-
22
+
23
23
=== Object Types
24
24
25
25
The available objects are:
@@ -35,15 +35,15 @@ The available objects are:
35
35
* visits
36
36
37
37
=== Querying Objects
38
-
38
+
39
39
http://developer.pardot.com/kb/api-version-3/querying-prospects
40
-
40
+
41
41
Most objects accept limit, offset, sort_by, and sord_order parameters
42
42
43
43
prospects = client.prospects.query(:assigned => false, :sort_by => "last_activity_at", :limit => 20)
44
-
44
+
45
45
prospects["total_results"] # number of prospects found
46
-
46
+
47
47
prospects["prospect"].each do |prospect|
48
48
puts prospect["first_name"]
49
49
end
@@ -55,11 +55,11 @@ See each individual object's API reference page for available methods
55
55
http://developer.pardot.com/kb/api-version-3/using-prospects
56
56
57
57
prospect = client.prospects.create("
[email protected] ", :first_name => "John", :last_name => "Doe")
58
-
58
+
59
59
prospect.each do |key, value|
60
60
puts "#{key} is #{value}"
61
61
end
62
-
62
+
63
63
=== Emails
64
64
65
65
See each individual call's [API reference page](http://developer.pardot.com/kb/api-version-3/introduction-table-of-contents).
@@ -68,15 +68,15 @@ See each individual call's [API reference page](http://developer.pardot.com/kb/a
68
68
@pardot.emails.read_by_id(email_id)
69
69
@pardot.emails.send_to_list(:email_template_id => template_id, 'list_ids[]' => list_id, :campaign_id => campaign_id)
70
70
@pardot.emails.send_to_prospect(prospect_id, :campaign_id => campaign_id, :email_template_id => template_id)
71
-
71
+
72
72
=== Output formats
73
-
73
+
74
74
client.format = "simple" # default
75
75
client.format = "mobile"
76
76
client.format = "full"
77
77
78
78
=== Error handling
79
-
79
+
80
80
Pardot will respond with an error message when you provide invalid parameters
81
81
82
82
begin
@@ -86,7 +86,7 @@ Pardot will respond with an error message when you provide invalid parameters
86
86
end
87
87
88
88
Performing API calls across the internet is inherently unsafe, so be sure to catch the exceptions
89
-
89
+
90
90
begin
91
91
visitor = client.visitors.query(:id_greater_than => 200)
92
92
rescue Pardot::NetError => e
0 commit comments