Q:

Fetching Contact image from SugarCRM

I'm trying to integrate my rails app with SugarCRM. Is it possible to fetch the Contact picture from SugarCRM using REST API? Please let me know.  

A:

To get the profile image for a user do the following:

Call the login method through REST
Call the get_entry_list method through REST, with the following parameters:

Module: Users
Query: users.user_name = 'xxxx'
Select_fields: picture

The response contains the filename for the profile image, which is stored in /uploads. 
However, it is not possible to view the image in that folder due to .htaccess restrictions for security reasons, but other options exist:

Extend the REST API with a method to serve profile images (similar to get_document_revision)
Login on the server from your rails app and get the image
Create a simple entrypoint+module in SugarCRM, which can show the picture
Remove the .htaccess restiction for images (if it doesn't create a security risk in your setup)

