Re: Custom Marketo API for fields

Alec_Lieberman
Level 1

Custom Marketo API for fields

Hello,

Is there a way in Marketo to create some type of custom API endpoint that will allow me to return a list of fields for a given country name?

This is my use case:

I want my marketing team to be able to manage a list of questions in Marketo. These questions will be conditionally shown to a user depending on the country they are from. I will then have a custom form on a proprietary website that will fetch these questions from this Marketo API based on their country.

Is this possible?

Thank you!

2 REPLIES 2
Mariah_Mattick
Level 4

Re: Custom Marketo API for fields

Have you looked into visibility rules? These may be able to do what you're describing without custom coding: Dynamically Toggle Visibility of a Form Field - Marketo Docs - Product Documentation . 

Mariah Mattick
SanfordWhiteman
Level 10 - Community Moderator

Re: Custom Marketo API for fields

The answer hinges on whether you're

  1. attempting some sort of good-faith confidentiality for the other countries' questions, that is, not allowing those questions to be inspected in the source of the page unless the person deliberately selects another country; and/or
  2. talking about so much data overall that loading it all at once would cause memory problems (unlikely but remotely possible, like if you have a total list of 100,000 entries and you want to only load + show 1000 at a time)

If you don't care that someone could inspect the form source and see all the other countries' questions, then you could do exactly as Mariah describes. Use Visibility Rules and have all the rules  in the Form Editor UI. Easy-peasy.

If you want to conceal the other countries' possible questions from an (extremely)  casual snooper, then you can't use VRs, because a curious person can see all the possible qs if they look at the JSON for the form. If you have a truly massive amount of data (like 50K+ possibilities) you'd also not want this in the form descriptor as it would slow loading. In either of these cases, you'd be out of luck because you're using a non-Marketo LP.  Conversely, if you were on a Marketo LP, you could upload a different file for each country in Design Studio and load only one of them, selectively.