wissel.net

Usability - Productivity - Business - The web - Singapore & Twins

Fun with LotusLive, cURL and Lotus Activities


Lets have some fun in six easy steps:
  1. Download and install cURL (for Ubuntu users:sudo apt-get install curl)
  2. Create one text file activity.xml with this content:
    <?xml version="1.0" encoding="utf-8"?>
    <entry xmlns="http://www.w3.org/2005/Atom">
    <category scheme="http://www.ibm.com/xmlns/prod/sn/type" term="activity" label="Activity"/>
    <title type="text">One activity to go </title>
    <content type="html">
    This is an &lt;b &gt;activity &lt;/b &gt; that has been automatically uploaded from the cURL command line
    </content>
    </entry>
  3. Create another text file todo.xml with this content:
    <?xml version="1.0" encoding="utf-8"?>
    <entry xmlns="http://www.w3.org/2005/Atom" xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
    <category scheme="http://www.ibm.com/xmlns/prod/sn/type" term="todo"/>
    <category term="Connection3.0"/>
    <category term="POT"/>
    <category term="NotesSensei"/>
    <title type="text">Some things that need to be done </title>
    <content type="html">
        This is an &lt;action &gt; in an activity that has been automatically uploaded from the cURL command line. You can happily ignore it.             
    </content>
    <snx:assignedto>put_your_eMail_here@and_your_domain.com </snx:assignedto>
    </entry>
  4. Open a command prompt and type:
    curl https://apps.lotuslive.com/activities/service/atom2/activities -X POST --user [username:password] --post301 --post302 --basic -k -L -H 'Content-type: application/atom+xml' --data @activity.xml -o result.xml
  5. Edit the result.xml and look for the href attribute of the <app:collection> element. Copy that URL.
  6. In your command prompt now type:
    curl [The_URL_You_Just_Copied] -X POST --user [username:password] --post301 --post302 --basic -k -L -H 'Content-type: application/atom+xml' --data @todo.xml
Congratulations! Just just created your first LotusLive Activity via the REST API. Works with Lotus Greenhouse too. cURL is also available for PHP developers.

Posted by on 10 November 2010 | Comments (1) | categories: IBM IBM - Lotus WebDevelopment

Comments

  1. posted by Miguel Angel Calvo on Friday 26 November 2010 AD:
    Hi Stephan,
    Thanks for the info. I was using windows curl and had some problems. This is the command that finally worked for me:

    >curl -X POST -u user@domain.com:pass --post301 --post302 --basic -k -L -H "Content-type: application/atom+xml" --data @activity.xml -o result.xml https://apps.lotuslive.com/activities/service/atom2/activities

    Pretty impressive stuff.