<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rasila Garage &#187; sugarcrm</title>
	<atom:link href="http://rasilagarage.com/tag/sugarcrm/feed/" rel="self" type="application/rss+xml" />
	<link>http://rasilagarage.com</link>
	<description>Tuomas Rasila's blog about software and entrepreneurship</description>
	<lastBuildDate>Sun, 07 Mar 2010 09:11:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Using SugarCRM&#8217;s SOAP-API with Python and SOAPpy</title>
		<link>http://rasilagarage.com/2009/02/using-sugarcrms-soap-api-with-python-and-soappy/</link>
		<comments>http://rasilagarage.com/2009/02/using-sugarcrms-soap-api-with-python-and-soappy/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 18:13:32 +0000</pubDate>
		<dc:creator>Tuomas Rasila</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[sugarcrm]]></category>

		<guid isPermaLink="false">http://rasilagarage.com/?p=195</guid>
		<description><![CDATA[SugarCRM is nowadays very widely used CRM system so I will cover it in my posts every now and then. At work we use it by ourselves to handle some processes and have been working with customers using it. There are things I like and thing I don&#8217;t like in SugarCRM. It is bit bloated [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sugarcrm.com/" onclick="pageTracker._trackPageview('/outgoing/www.sugarcrm.com/?referer=');">SugarCRM</a> is nowadays very widely used CRM system so I will cover it in my posts every now and then.</p>
<div id="attachment_206" class="wp-caption alignright" style="width: 310px"><a href="http://rasilagarage.com/wp-content/uploads/2009/02/picture-1.png"><img class="size-medium wp-image-206" title="Sugarsoap" src="http://rasilagarage.com/wp-content/uploads/2009/02/picture-1-300x139.png" alt="The API is not very well documented but you can browse its capabilities be opening http://URL-TO-SUGAR/soap.php in your browser" width="300" height="139" /></a><p class="wp-caption-text">The API is not very well documented but you can browse its capabilities be opening http://URL-TO-SUGAR/soap.php in your browser</p></div>
<p>At work we use it by ourselves to handle some processes and have been working with customers using it. There are things I like and thing I don&#8217;t like in SugarCRM. It is bit bloated and the code is not the most beautiful I have seen. On the other hand it does its job quite well and it is easy to configure without touching a line of code.</p>
<p>If you use a CRM in your business for a while you will most likely to find that you would like to do some integration. At work we have been doing various kinds of integration tasks. We have integrated a phone system to automatically make entries to SugarCRM when inbound or outbound calls have been made, connected registration of a web application to create a new accounts to CRM, connected a <a href="http://en.wikipedia.org/wiki/Laboratory_Information_Management_System" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/Laboratory_Information_Management_System?referer=');">LIMS</a> in various ways to it and so on. The reason I found SOAP-API to be the best way in most these cases is the fact that if you use it you won&#8217;t break down anything and it is likely that your code will work with future releases too. Off course there is a performance penalty and using SOAP API is not a good option when performance is an issue. So lets get to the business.<br />
<span id="more-195"></span><br />
<strong>Installing SOAPpy</strong><br />
I assume that installing Python module with easy_install is not a problem. However, latest version of <a href="http://pywebsvcs.sourceforge.net/" onclick="pageTracker._trackPageview('/outgoing/pywebsvcs.sourceforge.net/?referer=');">SOAPpy</a> was not compatible with Python 2.5. To install SOAPpy I would suggest the following:</p>
<p>1. Download and extract SOAPpy <a href="http://sourceforge.net/project/showfiles.php?group_id=26590&amp;package_id=18246" onclick="pageTracker._trackPageview('/outgoing/sourceforge.net/project/showfiles.php?group_id=26590_amp_package_id=18246&amp;referer=');">http://sourceforge.net/project/showfiles.php?group_id=26590&amp;package_id=18246</a></p>
<p>2. Move every &#8220;from __future__ import&#8221; lines to the beginning of the files where they are in. Below you can see the listing of these files.</p>
<pre class="brush:bash">
localhost:SOAPpy-0.12.0 tuomas$ grep -R __future__ SOAPpy/*.py
SOAPpy/Client.py:from __future__ import nested_scopes
SOAPpy/GSIServer.py:from __future__ import nested_scopes
SOAPpy/NS.py:from __future__ import nested_scopes
SOAPpy/Server.py:from __future__ import nested_scopes
SOAPpy/Types.py:from __future__ import nested_scopes
</pre>
<p>3. Install SOAPpy</p>
<pre class="brush:bash">
sudo python setup.py install
</pre>
<p><strong>The simplest possible example of SugarCRM + SOAPpy</strong><br />
The code below logs in to the SugarCRM, asks the version of the server and prints it. Here is the code:</p>
<pre class="brush:python">
import md5
import SOAPpy
USERNAME= "user"
PASSWORD= "pass"

auth = {'user_name': USERNAME, 'password': md5.new(PASSWORD).hexdigest(), "version": "1.1"}

# Url of SugarCRM + soap.php?wsdl
SUGAR_URL = 'http://192.160.0.1/soap.php?wsdl'

sugar = SOAPpy.WSDL.Proxy(SUGAR_URL)
session = sugar.login(auth, "foobar")

try:
    response = sugar.get_server_version()
except StandardError, err:
    print '\nError in information retrieval from SugarCRM:' + str(err)
print response
</pre>
<p>The API is not documented very well but you can list all of its capabilities by browsing yourself to http://URL-TO-SUGAR/soap.php.</p>
<p><strong>Advanced example</strong><br />
This script will log into SugarCRM and create a new Account.</p>
<pre class="brush:python">
import md5
import SOAPpy
USERNAME= "user"
PASSWORD= "pass"

auth = {'user_name': USERNAME, 'password': md5.new(PASSWORD).hexdigest(), "version": "1.1"}

# Url of SugarCRM + soap.php?wsdl
SUGAR_URL = 'http://192.160.0.1/soap.php?wsdl'

sugar = SOAPpy.WSDL.Proxy(SUGAR_URL)
session = sugar.login(auth, "foobar")
module = "Accounts"

adata = [{'name': 'name', 'value': "Test Account"},
           {'name': 'shipping_address_street', 'value': "Address test"}]
try:
    response = sugar.set_entry(session['id'], module, adata)
except StandardError, err:
     print '\nError in information retrieval from SugarCRM:' + str(err)
print response
</pre>
<p><strong>UPDATE:</strong> It appears to be that, Sugar Team is working with the <a href="http://developers.sugarcrm.com/wordpress/2009/02/11/draft-2-of-the-web-services-documentation-posted/" onclick="pageTracker._trackPageview('/outgoing/developers.sugarcrm.com/wordpress/2009/02/11/draft-2-of-the-web-services-documentation-posted/?referer=');">API and the documentation</a> at the moment and I&#8217;ll take back what I said about missing documentation. Thanks SugarCRM devs! </p>
]]></content:encoded>
			<wfw:commentRss>http://rasilagarage.com/2009/02/using-sugarcrms-soap-api-with-python-and-soappy/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Sugar Feeds, SugarCRM&#8217;s feeding system, where are the feeds?</title>
		<link>http://rasilagarage.com/2009/02/sugar-feeds-sugarcrms-feeding-system-where-are-the-feeds/</link>
		<comments>http://rasilagarage.com/2009/02/sugar-feeds-sugarcrms-feeding-system-where-are-the-feeds/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 19:00:30 +0000</pubDate>
		<dc:creator>Tuomas Rasila</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[sugarcrm]]></category>

		<guid isPermaLink="false">http://rasilagarage.com/?p=187</guid>
		<description><![CDATA[Today I was thinking about integrating our company&#8217;s SugarCRM with our Laconi.ca installation. I thought it would be cool, if our CRM could automatically tweet to Laconi.ca if e.g. a new case have been filed or mail has arrived to some of the group inboxes. There are several quite easy ways to do this. I [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was thinking about integrating our company&#8217;s <a href="http://www.sugarcrm.com/crm/download/sugar-suite.html" onclick="pageTracker._trackPageview('/outgoing/www.sugarcrm.com/crm/download/sugar-suite.html?referer=');">SugarCRM</a> with <a href="http://rasilagarage.com/2009/01/laconica-an-open-source-twitter-clone-behind-a-password-and-your-firewall/">our Laconi.ca</a> installation. I thought it would be cool, if our CRM could automatically tweet to <a href="http://laconi.ca" onclick="pageTracker._trackPageview('/outgoing/laconi.ca?referer=');">Laconi.ca</a> if e.g. a new case have been filed or mail has arrived to some of the group inboxes. There are several quite easy ways to do this. I began by logging into Sugar and looking around what data I would actually want to get out.</p>
<p>So as I clicked the Admin button and went to admin area I realized that there is a new version of SugarCRM available. Ok, I&#8217;ll install the new version first I thought hmm.. lets see release notes hmm.. a new feature <a href="http://developers.sugarcrm.com/wordpress/2009/01/13/care-and-feeding-of-the-sugar-feed-system/" onclick="pageTracker._trackPageview('/outgoing/developers.sugarcrm.com/wordpress/2009/01/13/care-and-feeding-of-the-sugar-feed-system/?referer=');">Sugar Feeds</a>, sounds cool. Maybe I could finally get <a href="http://trac.edgewall.org/" onclick="pageTracker._trackPageview('/outgoing/trac.edgewall.org/?referer=');">Trac</a> like timeline RSS feed from SugarCRM. Here is what release notes said:</p>
<blockquote><p>Sugar Feed enables users to be informed as soon as a user creates a new contact, lead, opportunity, or case. Users can add a My Sugar Feed dashlet on their Home page so that when a user performs any of these actions, a message displays in the dashlet on<br />
their Home page. Userscan also be notified when a lead is converted, when a case is closed, and when an opportunity is closed.<br />
Additionally, users can post status updates, external links, images, and YouTube videos for other users to view within the dashlet.</p>
<p><a href="http://www.sugarcrm.com/crm/index.php?action=docs&#038;enc=UTF-8&#038;v=5.2&#038;option=com_docs&#038;edition=OS&#038;&#038;doc=/docs/Release_Notes/CommunityEdition_ReleaseNotes_5.2/Sugar_Release_Notes_5.2.2.3.html" onclick="pageTracker._trackPageview('/outgoing/www.sugarcrm.com/crm/index.php?action=docs_038_enc=UTF-8_038_v=5.2_038_option=com_docs_038_edition=OS_038_038_doc=/docs/Release_Notes/CommunityEdition_ReleaseNotes_5.2/Sugar_Release_Notes_5.2.2.3.html&amp;referer=');">SugarCRM Community Edition5.2.2.3.h Release Notes</a>
</p></blockquote>
<p>After reading that I still continued to believe that this would be like users life stream RSS-feed. Guess what, it was not. Sugar Feeds is SugarCRM&#8217;s internal message sending service. Sure it sounds kinda cute &#8220;aww, now I can send these nice little messages to my co-workers&#8221; but really. As long as there is no API and no RSS why would anyone log in to SugarCRM to read and write these messages.</p>
<p>As much as I do value the effort of the SugarCRM&#8217;s team and their bold moves on the open source field, I still cannot understand who would want to use Sugar Feeds.</p>
]]></content:encoded>
			<wfw:commentRss>http://rasilagarage.com/2009/02/sugar-feeds-sugarcrms-feeding-system-where-are-the-feeds/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
