Class: Klaviyo::Profiles
Constant Summary collapse
- PERSON =
'person'
- PEOPLE =
'people'
- SEARCH =
'search'
Constants inherited from Client
Client::ALL, Client::BASE_API_URL, Client::CONTENT_JSON, Client::CONTENT_URL_FORM, Client::DEFAULT_COUNT, Client::DEFAULT_PAGE, Client::DEFAULT_SORT_DESC, Client::HTTP_DELETE, Client::HTTP_GET, Client::HTTP_POST, Client::HTTP_PUT, Client::METRIC, Client::METRICS, Client::TIMELINE, Client::V1_API, Client::V2_API
Class Method Summary collapse
-
.get_person_attributes(person_id) ⇒ Object
Retrieve all the data attributes for a Klaviyo Person ID.
-
.get_person_metric_timeline(person_id, metric_id, since: nil, count: DEFAULT_COUNT, sort: DEFAULT_SORT_DESC) ⇒ Object
Listing a person’s event timeline for a particular metric.
-
.get_person_metrics_timeline(person_id, since: nil, count: DEFAULT_COUNT, sort: DEFAULT_SORT_DESC) ⇒ Object
Listing a person’s event timeline.
-
.get_profile_id_by_email(email) ⇒ JSON
Retrieves the id of the profile given email.
-
.update_person_attributes(person_id, kwargs = {}) ⇒ Object
Add or update one more more attributes for a Person.
Class Method Details
.get_person_attributes(person_id) ⇒ Object
Retrieve all the data attributes for a Klaviyo Person ID.
21 22 23 24 |
# File 'lib/klaviyo/apis/profiles.rb', line 21 def self.get_person_attributes(person_id) path = "#{PERSON}/#{person_id}" v1_request(HTTP_GET, path) end |
.get_person_metric_timeline(person_id, metric_id, since: nil, count: DEFAULT_COUNT, sort: DEFAULT_SORT_DESC) ⇒ Object
Listing a person’s event timeline for a particular metric
58 59 60 61 62 63 64 65 66 |
# File 'lib/klaviyo/apis/profiles.rb', line 58 def self.get_person_metric_timeline(person_id, metric_id, since: nil, count: DEFAULT_COUNT, sort: DEFAULT_SORT_DESC) path = "#{PERSON}/#{person_id}/#{METRIC}/#{metric_id}/#{TIMELINE}" params = { :since => since, :count => count, :sort => sort } v1_request(HTTP_GET, path, params) end |
.get_person_metrics_timeline(person_id, since: nil, count: DEFAULT_COUNT, sort: DEFAULT_SORT_DESC) ⇒ Object
Listing a person’s event timeline
41 42 43 44 45 46 47 48 49 |
# File 'lib/klaviyo/apis/profiles.rb', line 41 def self.get_person_metrics_timeline(person_id, since: nil, count: DEFAULT_COUNT, sort: DEFAULT_SORT_DESC) path = "#{PERSON}/#{person_id}/#{METRICS}/#{TIMELINE}" params = { :since => since, :count => count, :sort => sort } v1_request(HTTP_GET, path, params) end |