Hi all,
I got a little time to mess with this last night, and here's what I came up with. I tried to make ImportJSON work, and eventually got a little more ambitious: I decided that it is simple enough to write my own functions, and not rely on ImportJSON. Beware... this is a work-in-progress, and does not do exactly what you requested.
I wrote some Apps Script (practically identical to Javascript) to create a sidebar that populates with names of lists pulled from the REST API. It also has "Insert" buttons that currently append the first 100 entries of the specified list (the first API call of a paginated result set) to the end of the active spreadsheet. I have posted this code in a public GitHub repository under the MIT license, so feel free to grab it here:
https://github.com/elixiter/mkto_google-spreadsheetI know you are looking for some sort of real-time synchronization, and that is totally possible... this is just a simple proof-of-concept. You can certainly fork the project and improve it yourself, or Watch the repo for updates.
If you intend to try this code yourself,
be sure to read the configuration section of the readme, also embedded in the code as a comment.
Some caveats:
1. Neither the code nor the interface is polished in any sense.
2. It currently only pulls 4 fields: id, email, firstName, lastName
3. If you (or I) end up adapting this code to pull more than 100 records at a time, we may quickly hit the 20s API limit of 100 calls (that would definitely happen with a list of 10k+ leads).
4. This must be run by a
priveleged user. The user would be able to see your REST API secret key. You really might as well just give these users Marketo logins and send them links to the lists, and not murder your API quota.
Happy fiddling!
Kyle