Hello everyone :wave: I'm looking to create a tap ...
# troubleshooting
o
Hello everyone đź‘‹ I'm looking to create a tap for the Partnerize API (specifically, the Conversion Items Report stream) using the cookiecutter SDK. I'm running into an issue with the API where passing the full date range doesn't work as expected, so I need to chunk the requests into a separate HTTP request per day. Is there a conventional way to do that within the cookiecutter SDK? I was looking at overriding
get_next_page_token()
to treat it like pagination, but wanted to make sure I'm incrementing the date query params with each HTTP request, so I need to figure out where the request is being made and possible overload that function to make multiple requests instead of one.
p
You should be able to implement this with a paginator. If the date is part of the request’s query params, you can override the
get_url_params
method and use it there. You can pass the date range to the paginator object you create in
get_new_paginator
and have that class’s
get_next
method just return the next date in the range.
If each date might also contain multiple pages, it gets a little more complicated, but shouldn’t be impossible, you just need the
get_next
method to return both the date and the page token.
o
Okay that makes a lot of sense, thank you! The paginator object is a huge help. I wasn't aware of that. Thanks!
I also see request_records() which seems to handle pagination, as well. I guess they're all simplified with the use of the paginator object