Downloading a Document Revision via Web Services

Matthew Marum —  August 20, 2012 — 2 Comments

We talked last week about how to create a new Document record and upload versions of the document to Sugar via SugarCRM’s Web Services API. Today, we’ll see how to download a revision of a document in a Document record.

The method we’ll use here is get_document_revision, which will return the file for the given Document Revision ID passed to it. Here’s how it works to grab a revision and save the file on your local machine.

Come back tomorrow to see how to download Note attachments.

Matthew Marum


Matt is the Director of Developer Advocacy for SugarCRM. Previously he was an Engineer on Sugar 7 and a Solutions Architect for the OEM program. He is also an avid trail runner, Boston Marathon qualifier and a karaoke aficionado.

2 responses to Downloading a Document Revision via Web Services


    Thanks for this example, but how can I get the latest revision id, if I have Document id?

Trackbacks and Pingbacks:

  1. SugarCRM Developer Blog » Blog Archive » How to get Document content through PHP code - May 15, 2013

    […] covered grabbing Documents over Web Services in the past, but how about if you are wanting to do it inside the Sugar code base itself? Try this snippet for […]

Leave a Reply

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

You are commenting using your 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