Skip to main content
Problem Solver I
November 26, 2024
Solved

Best way to refresh integration status

  • November 26, 2024
  • 5 replies
  • 98 views

Hello, I am a developer integrating Klaviyo in our app.

I am looking for the right way to know if a user has uninstalled the link to our app from Klaviyo’s side.

What I was going to do:
requesting for a new refresh token and if I get an error that it has been revoked, then I can remove it. 
This solution looks a bit “hacky” and might not be the best way to refresh the status of the integration.

I guess the best way would be to have a webhook for that, or maybe an endpoint to call. But I can’t find neither of those in the documentation :/

Should I proceed with my hacky solution, or do you have a better solution to suggest?

Fyi, currently using: https://github.com/klaviyo/klaviyo-api-node

    This topic has been closed for replies.
    Best answer by jeremykanso

    In the end, I might just need an endpoint to ping klaviyo and know if a token has been revoked or not.

    5 replies

    ryankelly
    Klaviyo Employee
    Klaviyo Employee
    November 26, 2024

    Hi Jeremy - 

    Would the status of mobile push consent meet this need? That is returned from the Get Profile/Get Profiles endpoint, like:

            "mobile_push": {
    "marketing": {
    "can_receive_push_marketing": true,
    "consent": "SUBSCRIBED",
    "consent_timestamp": "2023-02-21T20:07:38+00:00"
    }
    }

    You do need to request “subscriptions” in the additional-fields parameter.

    Problem Solver I
    November 27, 2024

    Hi Ryan,

    Thanks for answering!
    I guess that might work, I’ll test it.

    Problem Solver I
    November 27, 2024

    @ryankelly Ok I didn’t understand why you suggested that. Now I get it and I think you didn’t understand my need:

    => My question was not to know if a profile disabled notifications but if an integration has been removed.

    See this page: https://www.klaviyo.com/integrations

    jeremykansoAuthorAnswer
    Problem Solver I
    November 27, 2024

    In the end, I might just need an endpoint to ping klaviyo and know if a token has been revoked or not.

    ryankelly
    Klaviyo Employee
    Klaviyo Employee
    November 27, 2024

    @jeremykanso ah, yes, I misunderstood what you were after. As you found, we don’t currently have an endpoint to validate the status of an Oauth app install.

    I think your solution does make sense in the meantime.

    Tagging in ​@chloe.strange for viz.