Hi Dan, 2,500 Programs are downloaded in 13 API calls (batch size 200) so - while I agree it would be convenient to filter on 'last updated' - it's not a huge hog of API calls. Not sure if you're planning to download folders, emails, landing pages, forms or files, but the API pretty works the same for all assets: you have to download everything every time.
Thanks Jep - that's good to know (and the team is sticking with this approach).
Hope you're doing well - long time, no talk!
Hi Dan,
We are looking at pulling all emails and programs and store this data in our DB.
We still have not figured out how to pull more than 200 rondom records.
We want to know how this can be done by several API calls.
do you have an example for that call?
Idan
Jep Castelein Do you have an example for that? How can I download 2500 programs and emails in 13 API calls (batch size 200)?
Because now I am using this call: https://891-VEY-973.mktorest.com/rest/asset/v1/programs.json?access_token=<access token>&maxReturn=200
and each time I am getting the same 200 records and I don't know how I can download the next 200 programs and then the next 200 programs and so on...
Thank you!
Shiran
Hi Shiran (and Idan Dayag),
There are a few different ways to get around this based on your request parameters; the easiest (and the sanest for me in terms of structuring where to send data) has been to actually modify my approach and use byTag to replicate the structure inside the Marketo instance. However, what you're probably looking for is to use the offset parameter. So, if you have 2500 program, your first call would be
https://891-VEY-973.mktorest.com/rest/asset/v1/programs.json?access_token=access token&maxReturn=200
But your subsequent calls would be
https://891-VEY-973.mktorest.com/rest/asset/v1/programs.json?access_token=access token&maxReturn=200&offset=200
https://891-VEY-973.mktorest.com/rest/asset/v1/programs.json?access_token=access token&maxReturn=200&offset=400
https://891-VEY-973.mktorest.com/rest/asset/v1/programs.json?access_token=access token&maxReturn=200&offset=600
etc. through all the calls you need.
Add ‘offset=200’ to your call to get the 2nd batch