REST API documentation | Community
Skip to main content
September 2, 2014
Question

REST API documentation

  • September 2, 2014
  • 10 replies
  • 2288 views
HI, can you refer me to documentions & example codes for using Marketo Rest API for java development?
thanks,
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

10 replies

Dory_Viscoglio
Level 10
September 2, 2014
Hi Amnon, you can find the developer guides here: http://developers.marketo.com/documentation/rest/
September 2, 2014
But there are no java examples of REST there. i wanted to know if anyone knows of where i can find such examples.
thanks
September 2, 2014
Currently, examples for the REST API in Java are not available. Here are examples for PHP and Ruby:

https://github.com/dchesterton/marketo-rest-api

github.com/jalemieux/mkto_rest
September 4, 2014
Hi, the problem is i am trying to figure out how the json response looks like and there is no documentation that covers this fully.
For example this is what is shown in documentaiton for get lead: but this is not full, i see i am also getting "errors".
How can i know what response to expect?
  1. {
  2. "requestId":"e42b#14272d07d78",
  3. "success":true,
  4. "result":[
  5. {
  6. "id":60,
  7. "email":"kjashaedd@klooblept.com",
  8. "firstName":"Kataldar",
  9. "updatedAt":"2013-11-21T11:47:30-08:00"
  10. }
  11. ]
  12. }
thanks,
September 4, 2014
Could you please post the request you are making and error you are getting?
September 4, 2014
I fixed the problem. but i need to build the java rest objects according to the errors i receive.
If there is a missing field error i add a field. isn't there a java rest api library i can use that has all the objects for the rest call?

Another question, when i do Get Lead by Id i only get a few of the Lead's fields. how can i get the fields i want of the lead?
thanks
September 4, 2014
Hi Amnon,

The REST API is still somewhat limited, and Get Lead by Id does indeed return a small subset of the fields from a Lead record.

You may want to explore the SOAP API, instead of REST, which allows you to fetch all of the built-in and custom fields via a getLead call. It is a little more complicated, but is more mature, and there are more examples around the web for complex operations.

There are also Java code examples and a simple library provided by Marketo in this Github repository.

I hope this is more what you were looking for; if you are accessing the API programmatically, the added complexity is likely not a huge issue.

Best,
Kyle
September 7, 2014
Hi. i do use the SOAP API currently. I wanted to move to REST API cause i understood it is now ready for use and of course it is preferable to use it then SOAP.
As for the get Lead, i guess i can not use it for now.


September 7, 2014
Hi, so now, i am trying to work with update Lead and rest API. in SOAP i could pass a map which was dynamically created and i didn't have to know the fields in advance.
in Rest, it is defined that "input" field should be Array of lead records to create or update
how can i send a map dynamicaly created with changing attributes?
thanks
September 8, 2014
I would recommmend taking a look at Describe REST API:
http://developers.marketo.com/documentation/rest/describe/