Developer:FavouritesResource

From myExperiment
Jump to: navigation, search

Favouries Resource

Index of favourites

URI: GET http://www.myexperiment.org/favourites.xml

Example output:

<?xml version="1.0"?>
<favourites>
  <favourite uri="http://www.myexperiment.org/favourite.xml?id=1"/>
  <favourite uri="http://www.myexperiment.org/favourite.xml?id=2"/>
  <favourite uri="http://www.myexperiment.org/favourite.xml?id=4"/>
  <favourite uri="http://www.myexperiment.org/favourite.xml?id=6"/>
  <favourite uri="http://www.myexperiment.org/favourite.xml?id=8"/>
  ...
</favourites>


Create favourite

URI: POST http://www.myexperiment.org/favourite.xml

Example input:

<favourite>
  <title/>
  <object resource="http://www.myexperiment.org/workflows/749"/>
</favourite>


Example output:

<?xml version="1.0"?>
<favourite uri="http://www.myexperiment.org/favourite.xml?id=78">
  <id>78</id>
  <user resource="http://www.myexperiment.org/users/22" uri="http://www.myexperiment.org/user.xml?id=22">Don Cruickshank</user>
  <title/>
  <object>
    <workflow resource="http://www.myexperiment.org/workflows/749" uri="http://www.myexperiment.org/workflow.xml?id=749" version="1">DOI Record Generator</workflow>
  </object>
  <created-at>Wed Sep 30 11:01:59 +0100 2009</created-at>
</favourite>


Read favourite

URI: GET http://www.myexperiment.org/favourite.xml?id=78

Example output:

<?xml version="1.0"?>
<favourite uri="http://www.myexperiment.org/favourite.xml?id=78">
  <id>78</id>
  <user resource="http://www.myexperiment.org/users/22" uri="http://www.myexperiment.org/user.xml?id=22">Don Cruickshank</user>
  <title/>
  <object>
    <workflow resource="http://www.myexperiment.org/workflows/749" uri="http://www.myexperiment.org/workflow.xml?id=749" version="1">DOI Record Generator</workflow>
  </object>
  <created-at>Wed Sep 30 11:01:59 +0100 2009</created-at>
</favourite>


Update favourite

Implemented - not documented.


Delete favourite

URI: DELETE http://www.myexperiment.org/favourite.xml?id=78

Example output:

<?xml version="1.0"?>
<favourite uri="http://www.myexperiment.org/favourite.xml?id=78">
  <id>78</id>
  <user resource="http://www.myexperiment.org/users/22" uri="http://www.myexperiment.org/user.xml?id=22">Don Cruickshank</user>
  <title/>
  <object>
    <workflow resource="http://www.myexperiment.org/workflows/749" uri="http://www.myexperiment.org/workflow.xml?id=749" version="1">DOI Record Generator</workflow>
  </object>
  <created-at>Wed Sep 30 11:01:59 +0100 2009</created-at>
</favourite>


Elements for favourite

  • id - the id of the favourite
  • user - the user who created the favourite for themselves
  • title - the title of favourite
  • object - the object that is being made a favourite (e.g. a workflow, file, pack, etc.)
  • created-at - the date/time the favourite was created