Comments (5)
Hi @wdifruscio
We do have an upsert profile API that is a "create or update" with a single call, and returns the profile that was created/updated. (Docs)
Is this what you mean? This API should still be available
from klaviyo-api-python.
I'd second that a get_or_create method would be helpful. I ended up implementing my own method which calls klaviyo.Profiles.get_profiles(filter=f'equals(email,"{email}")')
and if no profile is returned will call klaviyo.Profiles.create_profile(data)
. Recently, we've had 4 or 5 errors with the method as the get_profiles returns none but the create_profile call throws and ApiException with A profile already exists with one of these identifiers.
. I'm assuming there is some kind of race condition happening so I'll be rescuing it and retrying the get_profiles call but would be helpful if this was handled within the library itself and I didn't need to implement the custom logic myself.
from klaviyo-api-python.
@nburt sorry for the delay in reply. would the create_or_update
as @jason-myers-klaviyo method not work for you in this scenario?
from klaviyo-api-python.
Hi all,
sorry - I've been meaning to reply here
Yes I did implement this, but I found the entire migration to this new system to be pretty irritating, and the documentation to be sub-par. It is a considerable cost to run these services, if this was open source I would be more forgiving and probably would not be publicly whining
I totally get why things were moved into the system that they are now - it is standardized and basically follows a known convention - which in theory is very nice - but documentation and path to upgrade could have been well thought out - the emails to upgrade were nice, but actual information was not great
This change cost a considerable amount of hours, which really should have been done within an afternoon, as the original implementation was, so I am bit dissapointed in everything. I use this sdk with several companies and had to painfully line by line the new arduous implemention with multiple developers who were equally annoyed and confused
from klaviyo-api-python.
@sanfordj our use case has been that we're trying to find or create a profile prior to sending events for them (viewed product, started checkout, placed order) so that we can send the profile ID along with the event. I suppose we could do a create_or_update with empty values but we aren't actually updating the profile so I think that a find or create API would be more appropriate.
from klaviyo-api-python.
Related Issues (20)
- Missing positional argument "id" even though it is provided HOT 2
- Rendering templates HOT 1
- Feature request: Bulk setting/unsetting of user properties HOT 4
- fields[profile] parameter not working HOT 2
- permissions issue with getting lists + campaign audience type (List\Segment) HOT 1
- klaviyo.Templates.get_template return error 500 HOT 3
- Klaviyo API hangs once every 10-20 requests HOT 4
- _from_openapi_data() missing 1 required positional argument: 'name' on create event HOT 2
- _from_openapi_data() missing 1 required positional argument: 'name' on create event HOT 1
- Need basic documentation on how Track and Identify map into this new API HOT 1
- bug in profile unset property functionality HOT 2
- 400 HTTP errors with get_events() per specific metric ids HOT 4
- Pydantic v2 compatibility HOT 10
- Get Profiles: Phone Numbers Return In Wrong Format HOT 4
- Events.create_event doesn't seem to send the value_currency parameter HOT 4
- filter param duplicated in version 8.0.0 HOT 2
- synchronous profile subscribe removed from v8.0.0 HOT 4
- Feature Request: add async support HOT 2
- additional_fields_profile=['subscriptions'] throwing error HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from klaviyo-api-python.