REST API to get all lead attributes | Community
Skip to main content
December 3, 2015
Solved

REST API to get all lead attributes

  • December 3, 2015
  • 1 reply
  • 2565 views

Hello,

Is there a way to get all attributes of a lead using the REST API?  Specifically, I would like to pull for any attributes that could be added to a Marketo Form.  Looking at the documentation (Get Lead by Id » Marketo Developers ), I can either get a few basic fields of a lead or I can specify all the fields I want.  I am guessing this may not be possible/desirable due to the amount of potential data that could be returned.

Background on my scenario

From what I understand, Marketo landing page form pre-population works based on the lead associated with a specific cookie.  Setting that lead association can be done by simply entering in an email value on a form and submitting, so I am not comfortable using that in some scenarios (someone can easily populate all form fields by simply knowing the email address).  Instead, I would like to use a form embed on the client, retrieve the lead information via REST call on the server (as a trusted authenticated user), then set each of the form values using that information using generic logic that inspects the form fields available.  Primarily looking for answer to first question, but constructive feedback on alternate ways to achieve this are welcome also!

Thank you.

Eric

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

There's no equivalent to 'SELECT *', if you need all the fields then they need to all be listed.  The easiest way is by using Describe Lead and then iterating through each of the fields that have a rest field name.  It would probably be a good idea to cache both the response from describe and the resulting string of fields, as well.

1 reply

Kenny_Elkington
Kenny_ElkingtonAccepted solution
New Participant
December 3, 2015

There's no equivalent to 'SELECT *', if you need all the fields then they need to all be listed.  The easiest way is by using Describe Lead and then iterating through each of the fields that have a rest field name.  It would probably be a good idea to cache both the response from describe and the resulting string of fields, as well.

December 4, 2015

The describe should help with what I'm trying - thank you Kenny!