Hi,
I want to retrieve value of all the fields available for a lead in marketo. Is there any generic api to get this or do i have to hard code all the field names in the url?when i am making a rest call with all the field names in url it is throwing a exception saying Url too long. Any pointers?
Solved! Go to Solution.
Use Content-Type as in my example. "Raw" is not appropriate here.
Hi Manisha,
You can use the "describe" api that will give you the list of fields. See Describe » Marketo Developers
-Greg
I do not want a list of fields i want to pull data of all the fields for leads.e.g:for each lead i want to get all data that is there in marketo.
Use the the Get Lead by Id Get Lead by Id » Marketo Developers or any other Get lead call.
But you will have to provide the list of fields you want to retrieve, so you will need to retrieve the field names first, hence my first answer.
-Greg
Yes that i have done already but when i am giving all the fields an exception is thrown saying the url is too large because there are so many fields. Hence my question.
Use the POST payload instead.
Include the additional parameter method=_GET.
_method=GET&fields=Email,Salutation,FirstName,..
can you share a sample post request with the payload? Not able to figure it out
I did share it.
POST /rest/v1/leads.json HTTP/1.1
Content-Type: application/x-www-form-urlencoded
_method=GET&fields=...
This is a standard HTTP form post. The _method emulation hint tells the server to parse the entity as an oversize GET.
This is how i tried.But unsuccessful.Can you tell what am i doing wrong?