Comments (5)
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.
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.
@jon-batscha any update on this please?
from klaviyo-api-python.
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.
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)
- How to use "page[size]" parameter? HOT 1
- how to avoid error when making many calls? HOT 1
- No Page Size in "get_profiles" HOT 1
- 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
- Templates Pagination not functioning HOT 6
- Klaviyo profile unable to subscribe: due to HTTPSConnectionPool HOT 2
- "Invalid cursor provided" Error for "get_events()" HOT 3
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.