Welcome to Morsel


What is Morsel?

Morsel

Morsel is a simple RESTful API (aka HTTP API) and web interface for communicating via Morse Code. The API was created with simple devices in mind, such as an Arduino powered networked connected Morse Code key/sounder.

In fact, Morsel comes with a sample sketch for Arduino which will hopefully help to get you started so you can get connected with Morsel as quickly as possible.

If you prefer or perhaps aren't near your physical device, once logging in or creating an account you can create a message via text or even by tapping.


The API

The Morsel API is very simple, and allows for a number of different interactions. Check out the docs for all of the details, but here is a quick example to give you an idea.

This*:
// create curl resource
$ch = curl_init();

// we will get the most recent transmission we have not yet receieved/read
curl_setopt($ch, CURLOPT_URL, "http://morsel.develpr.com/api/v1/transmissions?received=0");

//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// $output contains the output string
$output = curl_exec($ch);
var_dump($output);

// close curl resource to free up system resources
curl_close($ch);
		

* For authentication an Auth header is required, which is a user id as well as a simple HMAC "signature." We've tried not to go overboard (for instance use a less complex MD5 hash) with security to make the API accessible even to simple devices, while still offering some security.

Will yeild:
[
   {
	  "id":"1",
	  "message_id":"1",
	  "receiver_id":"2",
	  "sender_id":"1",
	  "received":"0",
	  "created_at":"2013-06-15 08:07:36",
	  "updated_at":"2013-06-15 08:07:36",
	  "deleted_at":null,
	  "message":{
		 "id":"1",
		 "user_id":"1",
		 "method":"intervals",
		 "raw":"a0b291a1b300a0b93a1b341a0b223",
		 "morse":"-.-",
		 "array":[
			{
			   "key":false,
			   "time":"291"
			},
			{
			   "key":true,
			   "time":"300"
			},
			{
			   "key":false,
			   "time":"93"
			},
			{
			   "key":true,
			   "time":"341"
			},
			{
			   "key":false,
			   "time":"223"
			}
		 ],
		 "text":"K",
		 "created_at":"2013-06-15 08:07:36",
		 "updated_at":"2013-06-15 08:07:36",
		 "deleted_at":null
	  }
   }
]