Last updated November 10, 2009 02:08, by Edwin Goei
Feedicon  

« Back to API Home     « Media Types - Overview    « Media Types - Project Related

Media Types - Wiki and Forum

This document covers the media types used with wiki and forum APIs. See the links at the top of this page for the other media types.

As described in Media Types - Overview, media types are indicated on each response by the Content-Type header. It is recommended (though not required at this time) that when you include an entity body in a request to the API, you use the appropriate media type in the request Content-Type header as well.

All media types currently use JSON, as indicated by the +json at the end of each type name.

Page

For a wiki feature, represents the data related to pages in the wiki. The APIs for wikis are described at Project Wiki Resource.

application/vnd.com.kenai.pages+json

A paginated list of pages.

For a description of the API that returns this media type, see Wiki List Pages.

$ curl -s http://kenai.com/api/projects/glassfish/features/wiki/pages.json?pretty=true
{
  "href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/wiki\/pages.json?pretty=true",
  "prev": null,
  "next": null,
  "total": 1,
  "pages": [
    {
      "href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/wiki\/pages\/Home.json",
      "name": "Home"
    }
  ],
  "content_type": "application\/vnd.com.kenai.pages+json"
}

Field Description
pages[i][href] URL to the individual page.
pages[i][name] Name of the page.

application/vnd.com.kenai.page+json

Data for an individual wiki page, including before (wiki markup) and after (HTML) rendering of the page.

For a description of the API that returns this media type, see Wiki Get Page.

$ curl -s http://kenai.com/api/projects/glassfish/features/wiki/pages/Home.json?pretty=true
{
  "href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/wiki\/pages\/Home.json",
  "name": "Home",
  "number": 1,
  "revisions_href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/wiki\/pages\/Home\/revisions.json",
  "person": "craigmcc",
  "text": "= Glassfish Community Wiki =\n\nThis is the default home page for your project's wiki.\n\nThis wiki uses Mediawiki formatting.\n",
  "created_at": "2009-07-15T01:52:53Z",
  "updated_at": "2009-07-15T01:52:53Z",
  "content_type": "application\/vnd.com.kenai.page+json",
  "html": "<h1><a name='Glassfish_Community_Wiki'><\/a> Glassfish Community Wiki <\/h1>\n<p>\nThis is the default home page for your project's wiki.\n\n<\/p><p>This wiki uses Mediawiki formatting.\n<\/p>"
}

Field Description
name The name or short identifier of the wiki page.
number The revision number of the page.
revisions_href   URL to the collection of revisions for the page.
person Username of person to last edit the page.
text Text of wiki markup forming the content of the page.
html Rendered HTML of the content of the page.

application/vnd.com.kenai.page.create+json

To create or update a page, PUT the following data to the wiki page resource URL.

Note: The page name is included in the resource URL and should not be included in the page create structure.

{
  "page": {
    "text": "Here is my new wiki home page!",
    "number": 1,
    "description": "Added new home page"
  }
}

For a description of the API that uses this media type, see Wiki Create/Update Page.

Field Description
page[text] The new text of the wiki page.
page[number] Current revision number of the page. If the page doesn't exist yet, this field can be omitted. Otherwise, the revision number must match the current revision number to successfully update the page. If the number does not match, a 409 Conflict status is returned.
page[description] (Optional) Comment describing this revision.

PageRevision

All the revisions for a single wiki page.

application/vnd.com.kenai.page.revisions+json

Paginated list of the revisions.

For a description of the API that returns this media type, see Wiki Get Page Revisions.

$ curl -s http://kenai.com/api/projects/glassfish/features/wiki/pages/Home/revisions.json?pretty=true
{
  "href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/wiki\/pages\/Home\/revisions.json?pretty=true",
  "prev": null,
  "next": null,
  "total": 1,
  "revisions": [
    {
      "href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/wiki\/pages\/Home\/revisions\/1.json",
      "name": "Home",
      "number": 1
    }
  ],
  "content_type": "application\/vnd.com.kenai.page.revisions+json"
}

Field Description
revisions[i][href] URL to the individual revision.
revisions[i][name] Name of the page revision.
revisions[i][number] Integer number of the revision.

application/vnd.com.kenai.page.revision+json

An individual page revision.

$ curl -s http://kenai.com/api/projects/glassfish/features/wiki/pages/Home/revisions/1.json?pretty=true
{
  "href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/wiki\/pages\/Home\/revisions\/1.json",
  "name": "Home",
  "number": 1,
  "page_href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/wiki\/pages\/Home.json",
  "person": "craigmcc",
  "description": null,
  "text": "= Glassfish Community Wiki =\n\nThis is the default home page for your project's wiki.\n\nThis wiki uses Mediawiki formatting.\n",
  "created_at": "2009-07-15T01:52:53Z",
  "content_type": "application\/vnd.com.kenai.page.revision+json"
}

Field Description
name Name of the page to which the revision belongs.
number Number of this revision.
page_href URL back to the page to which the revision belongs.
person Username of person who created this revision.
description   A revision comment.
text The text of the revision.

Image

For a wiki feature, represents the images that may be embedded in pages in the wiki. The APIs for wikis are described at Project Wiki Resource.

application/vnd.com.kenai.images+json

A paginated list of wiki images.

For a description of the API that returns this media type, see Wiki List Images.

$ curl 'https://kenai.com/api/projects/help/features/wiki/images.json?pretty=true&size=1'
{
  "href": "https://kenai.com/api/projects/help/features/wiki/images.json?pretty=true&size=1",
  "prev": null,
  "next": "https://kenai.com/api/projects/help/features/wiki/images.json?page=2&pretty=true&size=1",
  "total": 191,
  "images": [
    {
      "href": "https://kenai.com/api/projects/help/features/wiki/images/aracari.png.json",
      "filename": "aracari.png",
      "image_url": "http://kenai.com/attachments/wiki_images/help/aracari.png",
      "comments": "",
      "image_content_type": "image/png",
      "person": "pfussell",
      "size": 359299,
      "width": null,
      "height": null,
      "created_at": "2008-06-27T02:23:45Z",
      "updated_at": "2008-06-27T02:23:45Z"
    }
  ],
  "content_type": "application/vnd.com.kenai.images+json"

Field Description
images[i][href] URL to the individual wiki image descriptor.
images[i][filename] Filename of the wiki image which must be unique within the scope of a wiki instance.
images[i][image_url] URL where the image data can be downloaded.
images[i][comments] Comments for the image which may optionally be empty.
images[i][image_content_type] The content type of the image.
images[i][person] The username of the person who last updated the image.

application/vnd.com.kenai.image+json

Data for an individual wiki image.

For a description of the API that returns this media type, see Wiki Get Image.

$ curl -H 'Accept: application/json' "https://kenai.com/api/projects/help/features/wiki/images/aracari.png?pretty=true"
{
  "href": "https://kenai.com/api/projects/help/features/wiki/images/aracari.png",
  "filename": "aracari.png",
  "image_url": "http://kenai.com/attachments/wiki_images/help/aracari.png",
  "comments": "",
  "image_content_type": "image/png",
  "person": "pfussell",
  "size": 359299,
  "width": null,
  "height": null,
  "created_at": "2008-06-27T02:23:45Z",
  "updated_at": "2008-06-27T02:23:45Z",
  "content_type": "application/vnd.com.kenai.image+json"
}

See the preceding section for information about definition each field since it is identical.

Topic

All the topics in a forum. The APIs for project forums are described at Project Forums Resource.

application/vnd.com.kenai.topics+json

A paginated list of topics.

For a description of the API that returns this media type, see List Topics.

$ curl -s http://kenai.com/api/projects/glassfish/features/user/topics.json?pretty=true
{
  "href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/user\/topics.json?pretty=true",
  "prev": null,
  "next": null,
  "total": 3,
  "topics": [
    {
      "href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/user\/topics\/1-Glassfish-server-startup.json",
      "subject": "Glassfish server startup",
      "posts_href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/user\/topics\/1-Glassfish-server-startup\/posts.json"
    },
    {
      "href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/user\/topics\/2-How-to-indcrementally-publish.json",
      "subject": "How to indcrementally publish",
      "posts_href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/user\/topics\/2-How-to-indcrementally-publish\/posts.json"
    },
    {
      "href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/user\/topics\/3-Eclipse-GlassFish-Install-problem.json",
      "subject": "Eclipse GlassFish Install problem",
      "posts_href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/user\/topics\/3-Eclipse-GlassFish-Install-problem\/posts.json"
    }
  ],
  "content_type": "application\/vnd.com.kenai.topics+json"
}

Field Description
topics[i][href] URL to an individual topic.
topics[i][subject] Subject of the topic.
topics[i][posts_href] URL to the list of posts for the topic.

application/vnd.com.kenai.topic+json

The details of an individual topic.

For descriptiona of APIa that return this media type, see Topic Info, Topic Create, and Topic Update.

$ curl -s http://kenai.com/api/projects/glassfish/features/user/topics/1.json?pretty=true
{
  "href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/user\/topics\/1-Glassfish-server-startup.json",
  "subject": "Glassfish server startup",
  "posts_href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/user\/topics\/1-Glassfish-server-startup\/posts.json",
  "person": "jimberney",
  "post_count": 3,
  "view_count": 0,
  "last_post_at": "2009-07-15T01:52:58Z",
  "sticky": false,
  "locked": false,
  "created_at": "2009-07-15T01:52:57Z",
  "last_post_by": "jonathanschwartz",
  "content_type": "application\/vnd.com.kenai.topic+json"
}

Field Description
subject Subject of the topic.
posts_href URL to the list of posts for the topic.
person Username of the person who created the topic.
post_count Integer number of posts in the topic.
view_count Integer number of times the topic has been viewed.
last_post_at   ISO8601 formatted date of the time the most recent post was made.
last_post_by Username of the person who made the most recent post.
sticky Boolean indicating whether the topic has been marked as sticky, meaning it appears at the top of the list of topics.
locked Boolean indicating whether the topic has been marked as locked, meaning no more posts can be added to the topic.

application/vnd.com.kenai.topic.create+json

To create or update a topic, use the following structure. Creating a topic also creates a topic post containing the initial message in the forum.

{
  "topic": {
    "subject": "Newbie help",
    "message": "I need some help with APIs...",
    "sticky": false,
    "locked": false
  }
}

For descriptions of the APIs that use this media type, see Topic Create and Topic Update.

Field Description
topic[subject] Subject of the topic.
topic[message] Initial message for the topic post.
sticky (Optional) If you have administrator rights to the forum, you can set the sticky bit here. Ignored if you do not have admin rights.
locked (Optional) If you have administrator rights to the forum, you can set the locked bit here. Ignored if you do not have admin rights.

Post

Fetch and manipulate the posts within a single topic.

application/vnd.com.kenai.posts+json

List all posts in a topic.

For a description of the API that returns this media type, see List Posts.

$ curl -s http://kenai.com/api/projects/glassfish/features/user/topics/1-Glassfish-server-startup/posts.json?pretty=true
{
  "href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/user\/topics\/1-Glassfish-server-startup\/posts.json?pretty=true",
  "prev": null,
  "next": null,
  "total": 3,
  "posts": [
    {
      "href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/user\/topics\/1-Glassfish-server-startup\/posts\/1.json",
      "topic_href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/user\/topics\/1-Glassfish-server-startup.json",
      "message": "I can start the glassfish server from the commandline with --verbose to see the log output in the console.\n\nBut 
with the eclipseplugin, I don't know how to enable the verbose option. I can start\/stop the server, but errors \/ console output are 
not visible.\nThis would really be handy in development.\n\nI spend some time searching at google, but cannot find other people 
with this question. There must be a really simple solution, but i can't seem to find out.\n\nI tried:\n* output-to-console=true in the 
domain.xml\n* JPDA debug configuration in eclipse\n\nMaybe there is a better way to get the output into eclipse(without the 
verbose option)? \n",
      "message_format": "bbcode",
      "message_as_html": "I can start the glassfish server from the commandline with --verbose to see the log output in the console.
<br>\n<br>\nBut with the eclipseplugin, I don&#39;t know how to enable the verbose option. I can start\/stop the server, but errors \/ 
console output are not visible.<br>\nThis would really be handy in development.<br>\n<br>\nI spend some time searching at 
google, but cannot find other people with this question. There must be a really simple solution, but i can&#39;t seem to find 
out.<br>\n<br>\nI tried:<br>\n* output-to-console=true in the domain.xml<br>\n* JPDA debug configuration in eclipse<br>\n<br>
\nMaybe there is a better way to get the output into eclipse(without the verbose option)? <br>\n",
      "person": "jimberney",
      "editor": null,
      "edited_at": null,
      "position": "aa",
      "created_at": "2009-07-15T01:52:57Z"
    },
    {
      "href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/user\/topics\/1-Glassfish-server-startup\/posts\/2.json",
      "topic_href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/user\/topics\/1-Glassfish-server-startup.json",
      "message": "This is currently not possible :-(.\nYou'll have to open the log file via a separate app (tail...) to see it.\nWe had 
some issues with the output tab for Eclipse, and we hope this can be fixed in a later version of the plugin (soon)\n\nThanks for the 
feedback.\n",
      "message_format": "bbcode",
      "message_as_html": "This is currently not possible <img src=\"\/images\/forum\/frown.png\" alt=\"Frown\" \/>.<br>\nYou&#39;ll 
have to open the log file via a separate app (tail...) to see it.<br>\nWe had some issues with the output tab for Eclipse, and we 
hope this can be fixed in a later version of the plugin (soon)<br>\n<br>\nThanks for the feedback.<br>\n",
      "person": "srikanthramakrishna",
      "editor": null,
      "edited_at": null,
      "position": "ab",
      "created_at": "2009-07-15T01:52:58Z"
    },
    {
      "href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/user\/topics\/1-Glassfish-server-startup\/posts\/3.json",
      "topic_href": "http:\/\/kenai.com\/api\/projects\/glassfish\/features\/user\/topics\/1-Glassfish-server-startup.json",
      "message": "Thanks for the quick reply.\nGood to know it's not yet possible, now its more easy to accept it's not working.\n\nI'm 
now using tailxp. It's freeware and seems to work ok. \n",
      "message_format": "bbcode",
      "message_as_html": "Thanks for the quick reply.<br>\nGood to know it&#39;s not yet possible, now its more easy to accept 
it&#39;s not working.<br>\n<br>\nI&#39;m now using tailxp. It&#39;s freeware and seems to work ok. <br>\n",
      "person": "jonathanschwartz",
      "editor": null,
      "edited_at": null,
      "position": "ac",
      "created_at": "2009-07-15T01:52:58Z"
    }
  ],
  "content_type": "application\/vnd.com.kenai.posts+json"
}

Field Description
posts   An array of application/vnd.com.kenai.post+json hashes.

application/vnd.com.kenai.post+json

Fetch an individual post in a topic.

For descriptions of the APIs that use this media type, see Post Info, Post Create, and Post Update.

$ curl -s http://kenai.com/api/projects/glassfish/features/user/topics/1-Glassfish-server-startup/posts/3.json?pretty=true
{
  "href": "http:\/\/oldguard.local:3000\/api\/projects\/glassfish\/features\/user\/topics\/1-Glassfish-server-startup\/posts\/3.json",
  "topic_href": "http:\/\/oldguard.local:3000\/api\/projects\/glassfish\/features\/user\/topics\/1-Glassfish-server-startup.json",
  "message": "Thanks for the quick reply.\nGood to know it's not yet possible, now its more easy to accept it's not working.\n\nI'm 
now using tailxp. It's freeware and seems to work ok. \n",
  "message_format": "bbcode",
  "message_as_html": "Thanks for the quick reply.<br>\nGood to know it&#39;s not yet possible, now its more easy to accept 
it&#39;s not working.<br>\n<br>\nI&#39;m now using tailxp. It&#39;s freeware and seems to work ok. <br>\n",
  "person": "jonathanschwartz",
  "editor": null,
  "edited_at": null,
  "position": "ac",
  "created_at": "2009-07-15T01:52:58Z",
  "content_type": "application\/vnd.com.kenai.post+json"
}

Field Description
topic_href URL back up to parent topic.
message The post message body.
message_format The markup format used for the message body.
message_as_html   The message rendered as HTML.
person The username of the person who wrote the post.
editor The username of the person to last edit the post.
edited_at An ISO8601 formatted date when the post was edited.
position The threading or position of the post in the topic. The position value is a string that can be used to sort all posts in the topic. Additionally, the indentation is indicated by the number of characters in the string. Finally, the parent of this post will have 1 fewer characters and share the same prefix.

application/vnd.com.kenai.post.create+json

To create a post, POST a JSON payload with the following structure.

TODO: The structure does not currently accept a position element to specify what post you're responding to. See KENAI-970 for status.

{
  "post": {
    "message": "This is the post body",
    "message_format": "bbcode"
  }
}

For descriptions of the APIs that use this media type, see Post Create and Post Update.

Field Description
post[message] The post's message body.
post[message_format] (Optional) The markup format of the message, either bbcode or markdown.
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2014, Oracle Corporation and/or its affiliates
(revision 20150626.29986a4)
 
 
Close
loading
Please Confirm
Close