source-klaviyo: upgrade API version for campaigns
and profiles
to 2023-10-15
#2378
+28
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
While most streams are using version 2023-10-15 of Klaviyo's API,
campaigns
andprofiles
are on earlier versions. This PR updates both streams to use API version 2023-10-15.Changes from the updates are mainly to the location of certain properties in each stream's documents.
campaigns
The
attributes.message
property is now under therelationships.campaign-messages.data[0].id
location.profiles
The
attributes.subscriptions.email.marketing.suppressions
field is renamed toattributes.subscriptions.email.marketing.suppression
(i.e. from plural to singular).A note about
campaigns
. In API versions including 2023-10-15 and later, Klaviyo now has different types of campaigns. Previously, only email campaigns were returned from the/campaigns
endpoint, but in version 2023-10-15 SMS campaigns can also be fetched at that endpoint. However, only a single type of campaign can be fetched in a single request-response cycle because Klaviyo only accepts a single campaign type in the request's query params. While it's possible to rewrite thecampaigns
stream to fetch these additional campaign types by using stream slices & updated state management techniques, doing so is a relatively large effort. Since our currently enabled captures have email campaigns & no SMS campaigns,I'm punting on adding the functionality to fetch multiple types of campaigns in the
campaigns
stream to a later date.Closes #2367.
Workflow steps:
(How does one use this feature, and how has it changed)
Documentation links affected:
(list any documentation links that you created, or existing ones that you've identified as needing updates, along with a brief description)
Notes for reviewers:
Tested on a local stack. Confirmed
campaigns
andprofiles
streams fetch records and complete. Confirmed the other incremental streamevents
is not affected by the updates to theIncrementalKlaviyoStream
class.This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)