Thank you - your API key request will be handled manually. Expect a reply in the next few days.

API Service

Welcome to the shrib.com API service.

You can now use the API to read and write notes to shrib.com.

Please note that this is a brand new service. In order to get your API key, request it from me here:

application form

Syntax

The URL is

http://api.shrib.com/<note>

Where <note> is your note name (as in http://shrib.com/<note>).

The data is

HTTP Method

The recommended way to access the service is through a correct HTTP request (everything UTF-8):

  1. use the HTTP GET method to read a note, the HTTP POST method to write a note.

  2. send your API key as a HTTP header.

  3. to write a note: urlencode your note text in one POST field called "text" and send it as content-type application/x-www-form-urlencoded.

  4. use the URL http://api.shrib.com/<note>.

If the call is successful, the reply contains a HTTP header and the urlencoded (new) note text as text/plain. If there is an error, it is reported in the HTTP request/response line.

Here's an example PHP code to read a note (GET):

	<?php

	$ch = curl_init("http://api.shrib.com/<note>"); 
	curl_setopt($ch, CURLOPT_HEADER, FALSE);
	curl_setopt($ch, CURLOPT_HTTPHEADER, array('key: <key>'));
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	$response = curl_exec($ch);
	curl_close ($ch);
	$text=urldecode($response);
	echo '<pre>'.$text.'</pre>';

	?>

Here's an example PHP code to write a note (POST):

	<?php

	$ch = curl_init("http://api.shrib.com/<note>"); 
	curl_setopt($ch, CURLOPT_HEADER, FALSE);
	curl_setopt($ch, CURLOPT_HTTPHEADER, array('key: <key>'));
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, 'text='.urlencode('<text>'));
	$response = curl_exec($ch);
	curl_close ($ch);
	$text=urldecode($response);
	echo '<pre>'.$text.'</pre>';

	?>

URL Method

For testing purposes, there is also a URL-based method. However, this is not recommended. It requires you to put your API key into the URL.

Example: http://api.shrib.com/somenote?key=wer987lejf&text=testUrl

Restrictions

This is an experimental service. Currently, the following restrictions are applied: