Giter VIP home page Giter VIP logo

Comments (5)

jon-batscha avatar jon-batscha commented on July 19, 2024

Hey Adam! Great catch!

I'm looking at both our SDKs, as well as our docs (which use the same underlying spec as the SDK), and it looks like we are in fact missing the page[cursor] / page_cursor in both the docs and the SDK.

I'll connect with my team to raise this issue and release a fix as soon as we can.

In the mean time, to help me root-cause the issue, can you try the following:

Make an outright API request using the flows API Docs, and add in an additional page[cursor] (using the same pattern provided in our docs with a currently documented page[cursor]).

Let me know if you have any luck with that, and likewise, I'll follow up here once I've heard back from my team.

Thanks again for raising this, your feedback is super valuable!

Cheers,
Jon

from klaviyo-api-python.

bakobako avatar bakobako commented on July 19, 2024

When adding the additional page[cursor] I get the error:

{"errors":[{"id":"5141e3d7-1cfc-4deb-97fc-3fde014eeaf1","status":400,"code":"invalid","title":"Invalid input.","detail":"'page_cursor' is not a valid field for the resource 'flow'.","source":{"pointer":"/data/attributes/page_cursor"},"meta":{}}]}

code to test:

import requests
import json

url = "https://a.klaviyo.com/api/flows/"

headers = {
    "accept": "application/json",
    "revision": "2022-10-17",
    "Authorization": "Klaviyo-API-Key API_KEY"
}

response = requests.get(url, headers=headers)
response_data = json.loads(response.text)
next_link = response_data.get("links").get("next")

cursor_url = f"https://a.klaviyo.com/api/flows/?page[cursor]={next_link}"
cursor_response = requests.get(cursor_url, headers=headers)
print(cursor_response.text)

Even the official docs say that there is a offset pagination for the endpoint.
When i just use the link, it works:

import requests
import json

url = "https://a.klaviyo.com/api/flows/"

headers = {
    "accept": "application/json",
    "revision": "2022-10-17",
    "Authorization": "Klaviyo-API-Key API_KEY"
}

response = requests.get(url, headers=headers)
response_data = json.loads(response.text)
next_link = response_data.get("links").get("next")

cursor_url = next_link
cursor_response = requests.get(cursor_url, headers=headers)
print(cursor_response.text)

So I am hoping this can get integrated in the SDK

from klaviyo-api-python.

bakobako avatar bakobako commented on July 19, 2024

@jon-batscha any update on this please?

from klaviyo-api-python.

jon-batscha avatar jon-batscha commented on July 19, 2024

Hey! Thanks for reaching out, good catch! (and a timely one).

We have a fix for this, which we will be releasing within the next day, for our SDKs, as well as related services (docs, postman, etc).

Please, stay in touch and let us know of any further issues you come across. Your feedback is super valuable to us in improving our developer tools.

Cheers!
Jon

from klaviyo-api-python.

jon-batscha avatar jon-batscha commented on July 19, 2024

Following up on this:

I am happy to confirm that the updates we shipped yesterday resolved this issue. You can now page through flows using the same page_cursor interface as our other collection endpoints.

Again: thank you so much for catching this issue and bringing it to our attention. It takes great attention to detail on your part to catch a bug that went unnoticed by many others, and we greatly appreciate you reaching out to make us aware. If you run into any further issues, please do not hesitate to reach out.

Cheers!
Jon

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.