Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal of get_or_create profile #57

Open
wdifruscio opened this issue Jun 20, 2024 · 5 comments
Open

Removal of get_or_create profile #57

wdifruscio opened this issue Jun 20, 2024 · 5 comments

Comments

@wdifruscio
Copy link

wdifruscio commented Jun 20, 2024

is it possible for you guys to implement this back in?

one of the reasons I use klaviyo is so that I don't have to manage and track who is subscribed to what - with the new changes I now have to either run multiple calls to find out who a user is and what they are subscribed to, rather than just sending an email to an endpoint

also - to be clear, without this get_or_create profile - for me to add someone to a list I need to:

  1. run a get query to retrieve all profiles with an associated email
  2. write logic to determine if the profile is correct or not
  3. if no profile, create a new with required params
  4. otherwise request to add to the list with the id returned
@jason-myers-klaviyo
Copy link

jason-myers-klaviyo commented Jun 20, 2024

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)

def create_or_update_profile(

Is this what you mean? This API should still be available

@nburt
Copy link

nburt commented Jul 25, 2024

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.

@sanfordj
Copy link
Contributor

sanfordj commented Aug 5, 2024

@nburt sorry for the delay in reply. would the create_or_update as @jason-myers-klaviyo method not work for you in this scenario?

@wdifruscio
Copy link
Author

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

@nburt
Copy link

nburt commented Aug 6, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants