Skip to content

Commit 888485e

Browse files
author
klaviyo-sdk
committed
version 5.1.0
1 parent ae4703e commit 888485e

280 files changed

Lines changed: 2516 additions & 1222 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
NOTE: For more granular API-specific changes, please see our [API Changelog](https://developers.klaviyo.com/en/docs/changelog_)
99

10+
## [5.1.0] - revision 2023-08-15
11+
### Added
12+
- Flow Message Templates
13+
- You can now retrieve the templates associated with flow messages using `Flows.get_flow_message_template()` or `Flows.get_flow_message_relationships_template()` . You’re also able to include the template HTML for a flow message using `Flows.get_flow_message(id, include=['template'])`.
14+
- Create or Update Push Tokens
15+
- We have added an endpoint to create or update push tokens, `Profiles.create_push_token()`. This endpoint can be used to migrate profiles and their push tokens from another platform to Klaviyo. If you’re looking to register push tokens from users’ devices, please use our mobile SDKs.
16+
1017
## [5.0.0] - revision 2023-07-15
1118

1219
### Changed
@@ -131,4 +138,4 @@ NOTE: For more granular API-specific changes, please see our [API Changelog](htt
131138
- client name: `Client``KlaviyoAPI`
132139
- Client variable name in readme examples: `client``klaviyo`
133140
- Some functions have changed name
134-
- New resources and endpoints: see [API Changelog](https://developers.klaviyo.com/en/docs/changelog_) for full details
141+
- New resources and endpoints: see [API Changelog](https://developers.klaviyo.com/en/docs/changelog_) for full details

README.md

Lines changed: 220 additions & 176 deletions
Large diffs are not rendered by default.

klaviyo_api/wrapper.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class KlaviyoAPI:
3030
max_retries: int = 3
3131
test_host: str = ''
3232

33-
_REVISION = "2023-07-15"
33+
_REVISION = "2023-08-15"
3434

3535
_STATUS_CODE_CONNECTION_RESET_BY_PEER = 104
3636
_STATUS_CODE_TOO_MANY_REQUESTS = 429
@@ -206,6 +206,8 @@ def __post_init__(self):
206206
self.Flows.get_flow_message=self._page_cursor_update(self.retry_logic(self.Flows.get_flow_message))
207207
self.Flows.get_flow_message_action=self._page_cursor_update(self.retry_logic(self.Flows.get_flow_message_action))
208208
self.Flows.get_flow_message_relationships_action=self._page_cursor_update(self.retry_logic(self.Flows.get_flow_message_relationships_action))
209+
self.Flows.get_flow_message_relationships_template=self._page_cursor_update(self.retry_logic(self.Flows.get_flow_message_relationships_template))
210+
self.Flows.get_flow_message_template=self._page_cursor_update(self.retry_logic(self.Flows.get_flow_message_template))
209211
self.Flows.get_flow_relationships_flow_actions=self._page_cursor_update(self.retry_logic(self.Flows.get_flow_relationships_flow_actions))
210212
self.Flows.get_flow_relationships_tags=self._page_cursor_update(self.retry_logic(self.Flows.get_flow_relationships_tags))
211213
self.Flows.get_flow_tags=self._page_cursor_update(self.retry_logic(self.Flows.get_flow_tags))
@@ -244,6 +246,7 @@ def __post_init__(self):
244246

245247
## Applying tenacity retry decorator to each endpoint in Profiles
246248
self.Profiles.create_profile=self._page_cursor_update(self.retry_logic(self.Profiles.create_profile))
249+
self.Profiles.create_push_token=self._page_cursor_update(self.retry_logic(self.Profiles.create_push_token))
247250
self.Profiles.get_profile=self._page_cursor_update(self.retry_logic(self.Profiles.get_profile))
248251
self.Profiles.get_profile_lists=self._page_cursor_update(self.retry_logic(self.Profiles.get_profile_lists))
249252
self.Profiles.get_profile_relationships_lists=self._page_cursor_update(self.retry_logic(self.Profiles.get_profile_relationships_lists))

openapi_client/__init__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
88
The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. # noqa: E501
99
10-
The version of the OpenAPI document: 2023-07-15
10+
The version of the OpenAPI document: 2023-08-15
1111
1212
Generated by OpenAPI Generator (https://openapi-generator.tech)
1313
1414
Do not edit the class manually.
1515
"""
1616

1717

18-
__version__ = "5.0.0"
18+
__version__ = "5.1.0"
1919

2020
# import apis into sdk package
2121
from openapi_client.api.accounts_api import AccountsApi
@@ -165,6 +165,7 @@
165165
from openapi_client.models.data_privacy_deletion_job_enum import DataPrivacyDeletionJobEnum
166166
from openapi_client.models.data_privacy_profile_query_resource_object import DataPrivacyProfileQueryResourceObject
167167
from openapi_client.models.data_privacy_profile_query_resource_object_attributes import DataPrivacyProfileQueryResourceObjectAttributes
168+
from openapi_client.models.device_metadata import DeviceMetadata
168169
from openapi_client.models.event_create_query_v2 import EventCreateQueryV2
169170
from openapi_client.models.event_create_query_v2_resource_object import EventCreateQueryV2ResourceObject
170171
from openapi_client.models.event_create_query_v2_resource_object_attributes import EventCreateQueryV2ResourceObjectAttributes
@@ -220,6 +221,13 @@
220221
from openapi_client.models.profile_suppression_create_query_resource_object_attributes import ProfileSuppressionCreateQueryResourceObjectAttributes
221222
from openapi_client.models.profile_suppression_delete_query_resource_object import ProfileSuppressionDeleteQueryResourceObject
222223
from openapi_client.models.profile_suppression_delete_query_resource_object_attributes import ProfileSuppressionDeleteQueryResourceObjectAttributes
224+
from openapi_client.models.profile_upsert_query_resource_object import ProfileUpsertQueryResourceObject
225+
from openapi_client.models.profile_upsert_query_resource_object_attributes import ProfileUpsertQueryResourceObjectAttributes
226+
from openapi_client.models.push_token_create_query import PushTokenCreateQuery
227+
from openapi_client.models.push_token_create_query_resource_object import PushTokenCreateQueryResourceObject
228+
from openapi_client.models.push_token_create_query_resource_object_attributes import PushTokenCreateQueryResourceObjectAttributes
229+
from openapi_client.models.push_token_create_query_resource_object_attributes_profile import PushTokenCreateQueryResourceObjectAttributesProfile
230+
from openapi_client.models.push_token_enum import PushTokenEnum
223231
from openapi_client.models.render_options_sub_object import RenderOptionsSubObject
224232
from openapi_client.models.sto_schedule_options import STOScheduleOptions
225233
from openapi_client.models.segment_enum import SegmentEnum

openapi_client/api/accounts_api.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. # noqa: E501
77
8-
The version of the OpenAPI document: 2023-07-15
8+
The version of the OpenAPI document: 2023-08-15
99
1010
Generated by OpenAPI Generator (https://openapi-generator.tech)
1111
@@ -48,7 +48,7 @@ def __init__(self, api_client=None):
4848
self.api_client = api_client
4949

5050
@validate_arguments
51-
def get_account(self, id : Annotated[StrictStr, Field(..., description="The ID of the account")], fields_account : Annotated[Optional[conlist(StrictStr)], Field(description="For more information please visit https://developers.klaviyo.com/en/v2023-07-15/reference/api-overview#sparse-fieldsets")] = None, **kwargs) -> Dict[str, object]: # noqa: E501
51+
def get_account(self, id : Annotated[StrictStr, Field(..., description="The ID of the account")], fields_account : Annotated[Optional[conlist(StrictStr)], Field(description="For more information please visit https://developers.klaviyo.com/en/v2023-08-15/reference/api-overview#sparse-fieldsets")] = None, **kwargs) -> Dict[str, object]: # noqa: E501
5252
"""Get Account # noqa: E501
5353
5454
Retrieve a single account object by its account ID. You can only request the account by which the private API key was generated.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `accounts:read` # noqa: E501
@@ -60,7 +60,7 @@ def get_account(self, id : Annotated[StrictStr, Field(..., description="The ID o
6060
6161
:param id: The ID of the account (required)
6262
:type id: str
63-
:param fields_account: For more information please visit https://developers.klaviyo.com/en/v2023-07-15/reference/api-overview#sparse-fieldsets
63+
:param fields_account: For more information please visit https://developers.klaviyo.com/en/v2023-08-15/reference/api-overview#sparse-fieldsets
6464
:type fields_account: List[str]
6565
:param async_req: Whether to execute the request asynchronously.
6666
:type async_req: bool, optional
@@ -79,7 +79,7 @@ def get_account(self, id : Annotated[StrictStr, Field(..., description="The ID o
7979
return self.get_account_with_http_info(id, fields_account, **kwargs) # noqa: E501
8080

8181
@validate_arguments
82-
def get_account_with_http_info(self, id : Annotated[StrictStr, Field(..., description="The ID of the account")], fields_account : Annotated[Optional[conlist(StrictStr)], Field(description="For more information please visit https://developers.klaviyo.com/en/v2023-07-15/reference/api-overview#sparse-fieldsets")] = None, **kwargs) -> ApiResponse: # noqa: E501
82+
def get_account_with_http_info(self, id : Annotated[StrictStr, Field(..., description="The ID of the account")], fields_account : Annotated[Optional[conlist(StrictStr)], Field(description="For more information please visit https://developers.klaviyo.com/en/v2023-08-15/reference/api-overview#sparse-fieldsets")] = None, **kwargs) -> ApiResponse: # noqa: E501
8383
"""Get Account # noqa: E501
8484
8585
Retrieve a single account object by its account ID. You can only request the account by which the private API key was generated.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `accounts:read` # noqa: E501
@@ -91,7 +91,7 @@ def get_account_with_http_info(self, id : Annotated[StrictStr, Field(..., descri
9191
9292
:param id: The ID of the account (required)
9393
:type id: str
94-
:param fields_account: For more information please visit https://developers.klaviyo.com/en/v2023-07-15/reference/api-overview#sparse-fieldsets
94+
:param fields_account: For more information please visit https://developers.klaviyo.com/en/v2023-08-15/reference/api-overview#sparse-fieldsets
9595
:type fields_account: List[str]
9696
:param async_req: Whether to execute the request asynchronously.
9797
:type async_req: bool, optional
@@ -201,17 +201,17 @@ def get_account_with_http_info(self, id : Annotated[StrictStr, Field(..., descri
201201
_request_auth=_params.get('_request_auth'))
202202

203203
@validate_arguments
204-
def get_accounts(self, fields_account : Annotated[Optional[conlist(StrictStr)], Field(description="For more information please visit https://developers.klaviyo.com/en/v2023-07-15/reference/api-overview#sparse-fieldsets")] = None, **kwargs) -> Dict[str, object]: # noqa: E501
204+
def get_accounts(self, fields_account : Annotated[Optional[conlist(StrictStr)], Field(description="For more information please visit https://developers.klaviyo.com/en/v2023-08-15/reference/api-overview#sparse-fieldsets")] = None, **kwargs) -> Dict[str, object]: # noqa: E501
205205
"""Get Accounts # noqa: E501
206206
207-
Retrieve the account(s) associated with a given private API key. This will return 1 account object within the array. You can use this to retrieve account-specific data (contact information, timezone, currency, Public API key, etc.) or test if a Private API Key belongs to the correct account prior to performing subsequent actions with the API.\"<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `accounts:read` # noqa: E501
207+
Retrieve the account(s) associated with a given private API key. This will return 1 account object within the array. You can use this to retrieve account-specific data (contact information, timezone, currency, Public API key, etc.) or test if a Private API Key belongs to the correct account prior to performing subsequent actions with the API.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `accounts:read` # noqa: E501
208208
This method makes a synchronous HTTP request by default. To make an
209209
asynchronous HTTP request, please pass async_req=True
210210
211211
>>> thread = api.get_accounts(fields_account, async_req=True)
212212
>>> result = thread.get()
213213
214-
:param fields_account: For more information please visit https://developers.klaviyo.com/en/v2023-07-15/reference/api-overview#sparse-fieldsets
214+
:param fields_account: For more information please visit https://developers.klaviyo.com/en/v2023-08-15/reference/api-overview#sparse-fieldsets
215215
:type fields_account: List[str]
216216
:param async_req: Whether to execute the request asynchronously.
217217
:type async_req: bool, optional
@@ -230,17 +230,17 @@ def get_accounts(self, fields_account : Annotated[Optional[conlist(StrictStr)],
230230
return self.get_accounts_with_http_info(fields_account, **kwargs) # noqa: E501
231231

232232
@validate_arguments
233-
def get_accounts_with_http_info(self, fields_account : Annotated[Optional[conlist(StrictStr)], Field(description="For more information please visit https://developers.klaviyo.com/en/v2023-07-15/reference/api-overview#sparse-fieldsets")] = None, **kwargs) -> ApiResponse: # noqa: E501
233+
def get_accounts_with_http_info(self, fields_account : Annotated[Optional[conlist(StrictStr)], Field(description="For more information please visit https://developers.klaviyo.com/en/v2023-08-15/reference/api-overview#sparse-fieldsets")] = None, **kwargs) -> ApiResponse: # noqa: E501
234234
"""Get Accounts # noqa: E501
235235
236-
Retrieve the account(s) associated with a given private API key. This will return 1 account object within the array. You can use this to retrieve account-specific data (contact information, timezone, currency, Public API key, etc.) or test if a Private API Key belongs to the correct account prior to performing subsequent actions with the API.\"<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `accounts:read` # noqa: E501
236+
Retrieve the account(s) associated with a given private API key. This will return 1 account object within the array. You can use this to retrieve account-specific data (contact information, timezone, currency, Public API key, etc.) or test if a Private API Key belongs to the correct account prior to performing subsequent actions with the API.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `accounts:read` # noqa: E501
237237
This method makes a synchronous HTTP request by default. To make an
238238
asynchronous HTTP request, please pass async_req=True
239239
240240
>>> thread = api.get_accounts_with_http_info(fields_account, async_req=True)
241241
>>> result = thread.get()
242242
243-
:param fields_account: For more information please visit https://developers.klaviyo.com/en/v2023-07-15/reference/api-overview#sparse-fieldsets
243+
:param fields_account: For more information please visit https://developers.klaviyo.com/en/v2023-08-15/reference/api-overview#sparse-fieldsets
244244
:type fields_account: List[str]
245245
:param async_req: Whether to execute the request asynchronously.
246246
:type async_req: bool, optional

0 commit comments

Comments
 (0)