Please login to participate.
Wiki Page

XMLRPC API

.

    def getSiteTitle(self):
        """Return the site title"""
    def getRecentUpdates(self,maxitemcount=5,pagenumber=1):
        """Return the recent updates"""
    def refreshUpdateItem(self,uid):
        """Resends a single item of the same structure as the one in getRecentUpdates with the most updated info"""
    def getTypeInfo(self,typename):
        """Returns the type title and icon url for given typename"""
    def getUserInfo(self,userid):
        """Return the user name details, and avatar url for given userid"""
    def getWikiBody(self,uid):
        """Return the wiki body text, pre-cooked and processed"""
    def getEventInfo(self,uid):
        """Return the information available for a Calendar Event"""
    def getFileInfo(self,uid):
        """Return the info available for a file"""
    def getLinkInfo(self,uid):
        """Return the info available for a link"""
    def getBlogEntry(self,uid):
        """Return the info available for a Blog Entry"""
    def getComments(self,uid):
        """Return all the comments for the given object's UID"""
    def addNewComment(self,uid,subject,text,commenter):
        """Adds a comment on the provided UID with given subject, text and commenter user"""
    def replyToComment(self,uid,subject,text,commenter):
        """Replies to the given comment's UID with given subject, text and commenter user"""   
    def getUpdateCount(self):
        """Returns number of recent items available for recent user"""
    def search(self,searchableText,maxitemcount=5,pagenumber=1):
        """Returns result for search text entered for recent user"""
    def searchIds(self,searchableText='',maxitemcount=5,pagenumber=1):
        """Returns search results with only id, lastchangedate and relevance for search text entered."""
    def getStatusMessages(self,username='',count=1,pagenumber=1):
        """Returns current status message for passed username. For empty username method returns status message for current user"""
    def getStatusMessage(self,username=''):
        """Returns current status message of passed user as string"""
    def setStatusMessage(self,message):
        """Set status log message for current user"""
    def getLastChangeDate(self):
        """Returns the max lastchangedate for the logged in user."""
    def getRecentItemIds(self,maxitemcount=5,pagenumber=1):
        """Return the recent UIDs, up to a maximum of maxitemcount items will be returned in a list"""
    def getSearchItemsByIds(self,arrUIDs):
        """Return the search items as per the UIDs requested."""
    def getItemsByIds(self,maxitemcount=5,pagenumber=1):
        """Return the Update items as per the UIDs requested."""
    def getUsersByIds(self,arrUserIds):
        """Return the user info objects for the users specified"""
    def getTypesByNames(self,arrTypeNames):
        """Return the type info objects for the type names specified"""

Python Example

Create a script called 'sitetitle.py'

import xmlrpclib
username = "yourname"
password = "yourpassword"
siteurl = "http://www.cynapse.com/community" # change this to match your cyn.in portal
proxy = xmlrpclib.ServerProxy("http://%s:%s@%s/stacker" % (username,password,siteurl))
print proxy.getSiteTitle()

The expected output will look like this:

python sitetitle.py

similar code could easily be added to any python framework to support interaction with your cyn.in portal

PHP Example

To do this with PHP, look here: Getting new items via PHP and XMLRPC
Description
List of methods and their purpose that are currently exposed by cyn.in. This is maintained with respect to 2.1 release.
Comments (8)
pigeonflight Jan 15, 2010 11:49 AM
now I just need example snippets of using this api, for example with python's built in xmlrpc
dhiraj Jan 15, 2010 12:29 PM
The usage borders on ridiculously simple from python! :)

from xmlrpclib import ServerProxy
ser = ServerProxy("http://username:password@cyninsite/stacker")
ser.sayhello()
dhiraj Jan 15, 2010 12:31 PM
This documentation needs updating, the XMLRPC API has evolved a bit since last posting here. The key file to look at is interfaces.py

Actual implementation is in stacker.py
mdebus Jan 24, 2010 05:22 PM
Do you have any example code for PHP as well? I tried with phpxmlrpc but it seems not to work. TIA!
mdebus Jan 27, 2010 03:01 PM
Nevermind - got it. Wiki article here: [[getting-new-items-via-php-and-xmlrpc]]
pigeonflight Jan 30, 2010 04:31 AM
that stacker name isn't very "obvious", now that I know it I'm cool though
seletz Feb 03, 2010 08:48 PM
**please** have a look at the wsapi4plone effort and do integrate with it. http://pypi.python.org/pypi/wsapi4plone.core
dhiraj Feb 04, 2010 07:52 AM
Hi seletz,

We're already looking at wsapi4plone, and it's companion products. We'll hopefully integrate it in a future version.

I'd actually tried it out with Cyn.in a while back, it wasn't working with the default setup and Cyn.in content types, I think some effort is required, just didn't have the available effort and resources to go into it at the time. It's a good product, and we'll try to include it soon.
 
Loading