TiddlyHome Restful API

BidiX - 2008-09-27
tags: Documentation Design RESTful API
Following this model above the TiddlyHome1 API.


URI Resources


User

  • {username}
    Display the resource {username}

Namespace

  • {username}/namespaces
    Namespace container owns by {username}.
  • {username}/namespaces{namespace_id}
    {namespace_id} owns by {username}.

Tiddler

  • {username}/namespaces{namespace_id}/tiddlers
    Tiddler container in {namespace_id} owns by {username}.
  • {username}/namespaces{namespace_id}/tiddlers{tiddler_id}
    {tiddler_id} in {namespace_id} owns by {username}.

Tiddlywiki

  • {username}/tiddlywikis
    Tiddlywiki container own by {username}.
  • {username}/tiddlywikis{tiddlywiki_id}
    {tiddlywiki_id} owns by {username}.

Requests to TiddlyHome Service

Actually PUT is not implemented.

For now requested content-type (HTTP Request header) are not interpreted. All responses, except when specified, are in Content-type: text/html.

Return code conform to model.

User

  • GET {username}
    Return username and mail address.Need more developments.
  • GET www.google.com/accounts/ServiceLogin?...
    For now available only from a browser. Redirect to the current page once the login (or logout) is done.

Namespace

  • GET {username}/namespaces
    List of Namespace own by {username}.
  • POST {username}/namespaces
    Create or update namespace with these attributes :
    • name
    • access: 'on' | ''
    • owner_name:
    • previous_name: if different from name, previous name is deleted.
    • return_url: response redirect to this url
  • GET {username}/namespaces?new
    Return a form that submit a POST {username}/namespaces. This form is empty.
  • GET {username}/namespaces{namespace_id}
    return an HTML page for {namespace_id} details.
  • GET {username}/namespaces{namespace_id}?edit
    Return a form that submit a POST {username}/namespaces. This form is filled with {namespace_id} details.
  • DELETE {username}/namespaces{namespace_id}
    GET {username}/namespaces{namespace_id}?delete
    Delete {namespace_id}.

Tiddlywiki

  • GET {username}/tiddlywikis
    List of Tiddlywiki own by {username}.
  • POST {username}/tiddlywikis
    Create or update tiddlywiki with these attributes :
    • name
    • namespace_name
    • access: 'on' | ''
    • title
    • subtitle
    • {tiddler_title}: 'on' | '' (for each tiddler in {namespace_name})
    • previous_name: if different from name, previous name is deleted.
    • return_url: response redirect to this url
  • PUT {username}/tiddlywikis{tiddlywiki_id}?put
    POST {username}/tiddlywikis{tiddlywiki_id}?put
    Not documented
  • GET {username}/tiddlywikis?new
    Return a form that submit a POST {username}/tiddlywikis. This form is empty.
  • GET {username}/tiddlywikis{tiddlywiki_id}
    return an HTML page for {tiddlywiki_id} details.
  • GET {username}/tiddlywikis{tiddlywiki_id}.html
    return a TiddlyWiki page for {tiddlywiki_id}.
  • GET {username}/tiddlywikis{tiddlywiki_id}.xml
    return a xml page in RSS format for {tiddlywiki_id}.
  • GET {username}/tiddlywikis{tiddlywiki_id}?edit
    Return a form that submit a POST {username}/tiddlywikis. This form is filled with {tiddlywiki_id} details.
  • GET {username}/tiddlywikis{tiddlywiki_id}?upload
    Return a form that upload a TiddlyWiki a POST {username}/tiddlywikis{tiddlywiki_id}?put.
  • DELETE {username}/tiddlywikis{tiddlywiki_id}
    GET {username}/tiddlywikis{tiddlywiki_id}?delete
    Delete {tiddlywiki_id}.

Tiddler

  • GET {username}/namespaces{namespace_id}/tiddlers
    List of Tiddler in {namespace_id}.
  • POST {username}/namespaces{namespace_id}/tiddlers
    Create or update a tiddler with these attributes :
    • title
    • tags
    • text
    • html: wikified text
    • previous_title: if different from title, previous title is deleted.
    • return_url: response redirect to this url
  • GET {username}/namespaces{namespace_id}/tiddlers?new
    Return a form that submit a POST {username}/namespaces{namespace_id}/tiddlers. This form is empty.
  • GET {username}/namespaces{namespace_id}/tiddlers{tiddler_id}.html
    return an HTML page {tiddler_id} only with html content for publishing (Tiddlyhomes use this for HomePage and HelpPage).
  • GET {username}/namespaces{namespace_id}/tiddlers{tiddler_id}.txt
    return a text/plain page for {tiddler_id} text.
  • GET {username}/namespaces{namespace_id}/tiddlers{tiddler_id}.js
    return a text/plain page for {tiddler_id} text.
  • GET {username}/namespaces{namespace_id}/tiddlers{tiddler_id}.tw
    return a text/plain page for {tiddler_id} in TiddlyWiki StoreArea format.
  • GET {username}/namespaces{namespace_id}/tiddlers{tiddler_id}?edit
    Return a form that submit a POST {username}/namespaces{namespace_id}/tiddlers. This form is filled with {tiddler_id} details.
  • DELETE {username}/namespaces{namespace_id}/tiddlers{tiddler_id}
    GET {username}/namespaces{namespace_id}/tiddlers{tiddler_id}?delete
    Delete {tiddler_id}.