Re: Can I read all the fields of a lead via REST api ?

Anonymous
Not applicable

Can I read all the fields of a lead via REST api ?

I need to read all the feilds of Lead to prefill some of the marketo form values if they already exist. When I access a lead using the REST api I get only firstname and last name of the lead.

{"requestId":"ca8d#147ef0916dc","result":[{"id":72836,"updatedAt":"2014-08-18T20:51:22+0000","lastName":"doe","email":"john.doe@prnewswire.com","createdAt":"2014-07-21T19:00:21+0000","firstName":"john"}],"success":true}

Is there any parameter that must be set to request additional feilds. Please advice.
Tags (1)
6 REPLIES 6
Anonymous
Not applicable

Re: Can I read all the fields of a lead via REST api ?

Well, you just specify additional fields in the call, as documented here: http://developers.marketo.com/documentation/rest/get-lead-by-id/

You can get a list of fields from the Admin UI of Marketo or we are adding a Describe Lead API call next week, which you could also use.
Anonymous
Not applicable

Re: Can I read all the fields of a lead via REST api ?

Hi..

Thanks for the reply. But I don't see any documentation for requesting additional feilds on the link you have provided.

Can you please let me know the documentation for requesting additional feilds.
Anonymous
Not applicable

Re: Can I read all the fields of a lead via REST api ?

Here is how to get a list of fields that can be updated via REST API:
http://developers.marketo.com/documentation/rest/field-names

A
s Eric mentioned, you update lead fields by passing a JSON array:
http://developers.marketo.com/documentation/rest/createupdate-leads/
Anonymous
Not applicable

Re: Can I read all the fields of a lead via REST api ?

Thanks for the reply. But I I need to just read the lead data using /rest/v1/lead/{id}.json

You can get the fields by adding GET 'fields' parameter with value equal to CSV of fieldnames.
Anonymous
Not applicable

Re: Can I read all the fields of a lead via REST api ?

no answer for this?

i am looking for an example on how to GET the values from the SOAP api call ...
Anonymous
Not applicable

Re: Can I read all the fields of a lead via REST api ?

I banged my head on this for a while to get the specific syntax down. Do you need url encoding, do you need [s? do you need quotes? The answer is no. Here's an example:

https://111-ABC-222.mktorest.com/rest/v1/lead/2271601.json?fields=firstName,lastName,email,Custom_Fi...

Hopefully that saves some people some head banging.