<?xml version="1.0" encoding="UTF-8"?>
<page xmlns="http://api.springnote.com">
  <identifier type="integer">439001</identifier>
  <title>Springnote</title>
  <relation_is_part_of type="integer">438997</relation_is_part_of>
  <date_modified type="datetime">2008-10-29T09:49:36Z</date_modified>
  <uri>http://dev.springnote.com/pages/439001</uri>
  <date_created type="datetime">2007-08-28T02:26:50Z</date_created>
  <source>&lt;p&gt;Welcome to Springnote's REST API page.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div&gt;If you have any questions while using or reading our API, please utilize our &lt;a href="http://ecus-en.springnote.com/issues?tag=en_idea&amp;amp;tag=en_bugreport%20" class="external" title="http://ecus-en.springnote.com/issues?tag=en_idea&amp;amp;tag=en_bugreport "&gt;Suggestions/Bug Reports&lt;/a&gt;&amp;nbsp;forum to contact us.&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Preparation&lt;/h3&gt;
&lt;p&gt;In order to use the Springnote API, you need to understand the following items:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/HTTP" class="external" title="http://en.wikipedia.org/wiki/HTTP"&gt;HTTP(S) Protocol&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/REST" class="external" title="http://en.wikipedia.org/wiki/REST"&gt;REST Style&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://oauth.net/" class="external" title="http://oauth.net/"&gt;OAuth Authentication&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;These are all&amp;nbsp;de facto standards which are widely used.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Request&lt;/h3&gt;
&lt;p&gt;API request requires the following:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Authentication information&lt;/li&gt;
&lt;li&gt;Resource URL&lt;/li&gt;
&lt;li&gt;Content type&lt;/li&gt;
&lt;li&gt;HTTP method and paramaters&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Authentication&lt;/h3&gt;
&lt;p&gt;Although OAuth and basic HTTP authentication is provided together, we recommend that you utilize OAuth. For more detailed information, please refer to the &lt;a href="http://oauth.net/" class="external" title="http://oauth.net/"&gt;OAuth page&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To summarize, in order to access the notebook of a specified user, the user's Access Token is needed. After you have been issued the application from &amp;lt;Openmaru's API Center&amp;gt;, you can obtain tokens from the URLs listed below. This process is protected thus requiring an approval from the user.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Request Token URL: &lt;a href="https://api.openmaru.com/oauth/request_token"&gt;https://api.openmaru.com/oauth/request_token&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Authorize URL: &lt;a href="https://api.openmaru.com/oauth/authorize"&gt;https://api.openmaru.com/oauth/authorize&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Access Token URL: &lt;a href="https://api.openmaru.com/oauth/access_token/springnote"&gt;https://api.openmaru.com/oauth/access_token/springnote&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4&gt;Resource URL&lt;/h4&gt;
&lt;p&gt;All resources (Page, Attachment, etc.) provided by Springnote have its own URL. For example, in order to obtain information the page you are viewing now in XML, the following is requested:&lt;/p&gt;
&lt;p&gt;&lt;img title="Untitled-1.jpg" class="attachment" src="/pages/334480/attachments/901328" alt="Untitled-1.jpg" /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;HTTP methods that can be used differs depending on the resource. For example, &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;GET&lt;/span&gt;, &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;POST&lt;/span&gt;, &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;PUT&lt;/span&gt;, and &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;DELETE&lt;/span&gt; are all supported for the page resource &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;(/pages/#{id})&lt;/span&gt;. &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;GET&lt;/span&gt; and &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;POST&lt;/span&gt; are supported for page lists &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;(/pages)&lt;/span&gt; while &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;PUT&lt;/span&gt; and &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;DELETE&lt;/span&gt; are not.&lt;/li&gt;
&lt;li&gt;&lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;HTTP&lt;/span&gt; and &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;HTTPS&amp;nbsp;&lt;/span&gt;are supported&amp;nbsp;protocols which one is required to be selected and used.&lt;/li&gt;
&lt;li&gt;All API calls must be sent to the domain api.springnote.com.&lt;/li&gt;
&lt;li&gt;Each resource has its own URL.&lt;/li&gt;
&lt;li&gt;The extension is determined by the content type.&lt;/li&gt;
&lt;li&gt;The notebook domain can be defined&amp;nbsp;by using a domain parameter. In a case where the domain is omitted, the first personal notebook of the user is seleceted by default.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Content Type&lt;/h3&gt;
&lt;p&gt;All Springnote resources are provided in &lt;strong&gt;XML&lt;/strong&gt; and &lt;strong&gt;JSON&lt;/strong&gt; types. You can also use the methods listed below to specify a desired content type. (This is strictly required. API calling is not approved if the methods listed below are not used)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add an appropriate extension. In other words, add an extension to the end of the URL. Example) .xml or .json.&amp;nbsp; &lt;strong&gt;(RECOMMENDED)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;The &lt;span style="color: rgb(0, 0, 0); font-family: Courier New,monospace;"&gt;Content-Type Header&lt;/span&gt; request is filled by &lt;span style="color: rgb(0, 0, 0); font-family: Courier New,monospace;"&gt;application/xml&lt;/span&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;or&lt;/span&gt; &lt;span style="color: rgb(0, 0, 0); font-family: Courier New,monospace;"&gt;application/json&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The request and response type always correspond with each other. In other words, if you request through XML, the response will be given in XML.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Resource Parameters&lt;/h3&gt;
&lt;p&gt;Listed below are possible ways to send resources using POST and PUT methods to Springnote. For example, to create a new page, you need to include the resource parameter in the API and then make a request.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Resource is separated by attribute in the HTTP request parameter. The parameter value needs to be encoded, therefore the parameter name should be written as the resource (attribute) name. &lt;strong&gt;(RECOMMENDED)&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example) &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;POST&lt;/span&gt; &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;http://api.springnote.com/pages.xml?page[title]=NewPage&amp;amp;page[source]=test&amp;amp;page[relation_is_part_of]=1&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;XML or JSON is directed included into the HTTP request parameter. The parameter name is either &lt;em&gt;xml&lt;/em&gt; or &lt;em&gt;json&lt;/em&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example) &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;POST&lt;/span&gt; &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;http://api.springnote.com/pages.xml?&lt;strong&gt;xml&lt;/strong&gt;=&amp;lt;page&amp;gt;&amp;lt;title&amp;gt;NewPage&amp;lt;/title&amp;gt;...&amp;lt;/page&amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Add the resource to the HTTP body. At&amp;nbsp;the header of the HTTP request, &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;Content-Type&lt;/span&gt; must be accurately determined. For example, for &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;XML&lt;/span&gt; the &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;Content-Type&lt;/span&gt; must be application/xml, while &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;JSON&lt;/span&gt; must be &lt;span style="color: rgb(214, 26, 0); font-family: Courier New,monospace;"&gt;application/json&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;ol class="code"&gt;
&lt;li&gt;POST &lt;a href="http://api.springnote.com/pages.xml"&gt;/pages.xml&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Host: api.springnote.com&lt;/li&gt;
&lt;li&gt;Header: application/xml&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;lt;page&amp;gt;&amp;lt;title&amp;gt;NewPage&amp;lt;/title&amp;gt;...&amp;lt;/page&amp;gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Resource&lt;/h3&gt;
&lt;p&gt;Resources provided in Springnote's API are as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="/pages/439059" class="wiki" title="pages resource"&gt;Page resources&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/pages/439067" class="wiki" title="pages/*/attachments resource"&gt;Attachment resources&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/pages/439071" class="wiki" title="pages/*/revisions resource"&gt;Revision resources&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/pages/439076" class="wiki" title="pages/*/lock resource"&gt;Lock resources&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/pages/439073" class="wiki" title="pages/*/collaboration resource"&gt;Collaboration resources&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/pages/search?q=pages%2F*%2Fcomment%20resourcecomment%20resource&amp;amp;parent_id=439001" class="wiki" title="pages/*/comment resourcecomment resource"&gt;Comment resources&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Response&lt;/h3&gt;
&lt;p&gt;If the request is successful, resources in XML or JSON are provided along with 200 OK. If an error occurs, you will be provided with response status codes and an error message on your situation.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/pages/439037" title="Response Status code" class="wiki"&gt;Response Status code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/pages/439053" title="Error message" class="wiki"&gt;Error message&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4&gt;References&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/pages/439128" title="Library" class="wiki"&gt;Library&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://ecus-en.springnote.com/issues" class="external" title="http://ecus-en.springnote.com/issues"&gt;Communities&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
</source>
  <rights nil="true"></rights>
  <creator>deepblue</creator>
  <contributor_modified>deepblue</contributor_modified>
  <version type="integer">55</version>
  <tags></tags>
</page>
