I made a request to get lead data with filter using SOAP and REST from the same account. I am getting different responses in both the cases. How can REST and SOAP give different response for same request and on same account. I am getting Company and Phone attributes for lead record in SOAP response but I am not getting those attributes in REST response. Below are the files for request and responses of both SOAP and REST. Is this a bug in Marketo, Can any one help me out.
Thankyou
Solved! Go to Solution.
http://developers.marketo.com/rest-api/lead-database/leads/
"Both the Get Lead by Id and Get Leads by Filter Type will also accept a “fields” query parameter, which accepts a comma separated list of API fields. If this is included, then each record in the response will include those listed fields. If it is omitted, then a default set of fields will be returned: id, email, updatedAt, createdAt, firstName, and lastName."
It is working as designed. The documentation states you must include the fields parameter if you want fields other than ID, Email, Updated At, Created At, First Name, and Last Name.
Make sure you've supplied the fields parameter on the REST side.
How should we specify fields parameter. Can you please check my REST request and let me know how to do that.
It's right there in the REST docs.
When I use the fields parameter I could get the Phone and Company.
I guess the fields parameter is to limit the response to only the requested fields. If we do not specify the fields parameter expectation is that REST should return all the fields (which are not null values). I still feel that this is a bug in REST.
http://developers.marketo.com/rest-api/lead-database/leads/
"Both the Get Lead by Id and Get Leads by Filter Type will also accept a “fields” query parameter, which accepts a comma separated list of API fields. If this is included, then each record in the response will include those listed fields. If it is omitted, then a default set of fields will be returned: id, email, updatedAt, createdAt, firstName, and lastName."
It is working as designed. The documentation states you must include the fields parameter if you want fields other than ID, Email, Updated At, Created At, First Name, and Last Name.