SOLVED

Re: Difference in Responses for SOAP and REST

Go to solution
Anonymous
Not applicable

Difference in Responses for SOAP and REST

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

1 ACCEPTED SOLUTION

Accepted Solutions
Steven_Vanderb3
Marketo Employee

Re: Difference in Responses for SOAP and 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.

View solution in original post

5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: Difference in Responses for SOAP and REST

Make sure you've supplied the fields parameter on the REST side.

Anonymous
Not applicable

Re: Difference in Responses for SOAP and REST

How should we specify fields parameter. Can you please check my REST request and let me know how to do that.

SanfordWhiteman
Level 10 - Community Moderator

Re: Difference in Responses for SOAP and REST

It's right there in the REST docs.

Anonymous
Not applicable

Re: Difference in Responses for SOAP and REST

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.

Steven_Vanderb3
Marketo Employee

Re: Difference in Responses for SOAP and 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.