Get related Documents for an Account using the new RESTful API

John Mertic —  September 10, 2013 — 3 Comments

I came across a nice blog post by community member Antonio Mussara today, where he illustrated his answer to a StackOverflow question on how to get a list of all the related documents to an Account record. His response was based on the older v4_1 REST API, and so I thought it would be a good idea to update the example using the newer RESTful API in Sugar 6.7 and later to show how much easier it is to do.

Here’s the full original example from Antonio…

And here’s how to do it in the new REST API

Nearly half the lines of code, and much simpler to understand and work with. Another great reason to move over to using the new API :-)

John Mertic

Posts

John Mertic manages the strategic ISV alliances program for SugarCRM, having several years of techincal experience bringing solutions to market with several SugarCRM technology partners. A frequent conference speaker and an avid writer, he has been published in php|architect, IBM Developerworks, and in the Apple Developer Connection, and is the author of the book 'The Definitive Guide to SugarCRM: Better Business Applications' and the book 'Building on SugarCRM: Creating Applications the Easy Way'. He is also president of the OpenSocial foundation, guiding them in solving interoperability issues for enterprise application providers worldwide.

3 responses to Get related Documents for an Account using the new RESTful API

  1. 

    Hi John,
    the new model of API is considerably more RESTful style and you write a lot less code.

    Bye,
    Antonio.

  2. 

    Hi John,
    I noticed that the performances have improved, both the old and the new API (API version 4.1). On a standard installation, without applying tuning operations, the results for the same operation are:

    1) 0.97095394134521s on SugarCRM 6.5.15 Rest API 4.1;
    2) 0.49515700340271s on SugarCRM Ent 7.0 Rest API 4.1;
    3) 0.34343099594116s on SugarCRM Ent 7.0 Rest API 10

    Definitely the login process occupied lot of processing time and the introduction of OAuth2 for the login process I think it has improved the speed.

    I would say that a good start!

    Bye,
    Antonio.

Trackbacks and Pingbacks:

  1. Using SugarCRM’s New RESTful API | @pinegar - September 11, 2013

    […] I saw a post from Mr. John Mertic that described how to interact with the new API via CURL. While it’s a great piece of […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s