Featured image for blog post on how to mass approve landing pages using the Marketo API

Mass Approve Landing Pages Via API

If you have ever updated a landing page templates or edited a form used by a lot of landing pages in Marketo, you know how time consuming it can be to go back and reapprove all of the landing pages. Luckily, this is another area where the Marketo API can save us countless hours of work. We will use two simple calls and a feature in Postman called the runner.

By Landing Page Template

This one is a little bit more tricky because there is no endpoint to get all of the landing pages used by a landing page template, however you can either use the GET Landing Pages endpoint to get all Landing Pages or use a tool like Dataketo to do so. Once you have this, you can filter by template ID. This will give you all of the landing pages used by a template.

Get Forms Used By 

Forms has a GET Form Used By endpoint that we can use to find all of the landing pages (as well as other assets like smart campaigns) used by a form. You can use a call similar to the one below (just update the number with whatever form ID you want to use). Remember if you have more than 200 assets used by the form, you will need to increase the offset by 200 per call.

https://{{munchkin}}.mktorest.com/rest/asset/v1/form/1273/usedBy.json?maxReturn=200&offset=0

This gives us a JSON response. I use this tool to paste the JSON and it gives me a format that I can easily paste into and separate in Google Sheets. If you have other assets besides landing pages, you can filter those out at this time. The only column we need for this is the first column, the landing page ID. Once we have them, make sure the column name is ‘id’. Then you can download or save the file as a CSV for a later step.

Approve Landing Page Draft

Next we will want to use our approve landing page draft endpoint. Please notice that this is a POST instead of a GET so make sure you update that in Postman.The call should look like the one below. Notice that we have {{id}} as a variable in the URL and this should match exactly the column header from your csv as when we use the runner, it will look at that column and iterate through each row.

https://{{munchkin}}.mktorest.com/rest/asset/v1/landingPage/{{id}}/approveDraft.json

Runner

Scroll to the very top of your collection and click on the collection name (mine is Marketo). You need to click the ‘Run’ button on the right hand side. 

On the next screen, click on Deselect All because we only want to run through our Approve Landing Page Draft endpoint. Find that endpoint and click on it.

In the right panel click on select file and choose the CSV you save from above. You will see that the iterations automatically figures out how many rows to go through and should match the number of rows in your CSV. Set the delay to 300 ms as Marketo has a limit of 100 calls per 20 seconds so this will help safeguard against potential errors. Finally click Run Marketo (or whatever your collection name is). Go back and check Marketo and you will see the landing pages start to approve.

Similar Posts