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.
You can use the "describe" api that will give you the list of fields. See Describe » Marketo Developers
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.
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.
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
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?