API - Unable to get Emails by Program Id | Community
Skip to main content
New Participant
August 13, 2021
Question

API - Unable to get Emails by Program Id

  • August 13, 2021
  • 1 reply
  • 2382 views

Hi, I have the following folder structure.

|- Folder (id: 1123)

    |- Program (id: 3705)

       |-Folder (id: unknown)

          |- Email

 

When I call the endpoint: `https://{{munchkin}}.mktorest.com/rest/asset/v1/emails.json?maxReturn=60&folder={"id":3705,"type":"program"}` I get the following response:

{"success":true,"errors":[],"requestId":"565d#17b4032e97d","warnings":["No assets found for the given search criteria."]}

And when I run it by the parent folder (https://{{munchkin}}.mktorest.com/rest/asset/v1/emails.json?maxReturn=60&folder={"id":1123,"type":"Folder"}) I get the following response:

{"requestId":"17580#17b4033bc63","success":false,"warnings":[],"errors":[{"code":"711","message":"Invalid folder type for email"}]}

 

 My question is how can I get the emails that are part of the program? I have the program id but it does not return the data.

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

SanfordWhiteman
New Participant
August 15, 2021

As I’d think is self-evident from your question itself, you need to get the ID of the folder, since that’s the actual parent of the email assets.

HZ23Author
New Participant
August 19, 2021

yes, that's what I thought but the id of the folder inside of a program is nowhere to be found. Even on the Marketo platform, that folder is not clickable.

SanfordWhiteman
New Participant
August 20, 2021

Even on the Marketo platform, that folder is not clickable.

Certainly they’re clickable (that’s how you open/close them). Maybe what you mean is they don’t change the URL in the UI, which is true.

 

They’re absolutely queryable via REST API, you need to browse the parent Program.