Giter VIP home page Giter VIP logo

Comments (5)

jason-myers-klaviyo avatar jason-myers-klaviyo commented on August 18, 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

from klaviyo-api-python.

nburt avatar nburt commented on August 18, 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.

from klaviyo-api-python.

sanfordj avatar sanfordj commented on August 18, 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?

from klaviyo-api-python.

wdifruscio avatar wdifruscio commented on August 18, 2024

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.

nburt avatar nburt commented on August 18, 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.

from klaviyo-api-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.