Skip to content

Instantly share code, notes, and snippets.

@Hasimir
Forked from conatus/ello.md
Last active August 29, 2015 14:07
Show Gist options
  • Save Hasimir/5364f3ea2ff1566d3340 to your computer and use it in GitHub Desktop.
Save Hasimir/5364f3ea2ff1566d3340 to your computer and use it in GitHub Desktop.

Ello API

This is a basic exploration of the Ello API. Completely unofficial, your mileage my vary, don't smash their servers as they are likely very busy.

Methods return HTML for their representation where appropriate which is a nice little pattern. Everything returns application/json.

Like this:

{
   "id": <new post ID>,
   "content": <encoded HTML for display>
}

Authentication

Is session and cookie based. Grab the '_ello_session' cookie in an active Ello browser session.

Streams

Internally the Noise and Friends bit seem to be called "streams" but I can't see how to obtain them.

Obtaining A Single Post

GET https://ello.co/api/v1/posts/post_id.json

Failure 404 Not found, obviously.

Posting Posts

## Simple

POST https://ello.co/api/v1/posts.json

With a multipart/form-data input. One field must be "unsanitized_body", which should look like this:

[
   {
      "kind":"text",
      "data":"test"
   }
]

Links are sent in HTML and Markdown in Markdown.

## Image

Ello automatically uploads images to S3 for display, chucking them to ello-direct-uploads.s3.amazonaws.com - after it knows the image is done, it sends the following.

[
   {
      "kind":"image",
      "data":{
         "url":"some url",
         "via":"direct",
         "alt":"filename.png - though it probably can be a proper alt"
      }
   }
]

Success 200 Failure 422 - Unprocessable Entity

Clearly one can add more than one post to this array.

Editing Posts

PUT https://ello.co/api/v1/posts/[ID of post].json

Success 200 Failure 404 - Not found.

Same format as posting a post above.

Deleting Posts

DELETE https://ello.co/api/v1/posts/[ID of post]

Success 204 Failure 404 - Not found.

Friends List

GET /api/v1/followerships

Adding Comments

POST https://ello.co/api/v1/comments

Same format as posts, but with the addition of parent_post_id as an additional form field.

Removing Comments

PUT https://ello.co/api/v1/comments/

Same format as posts.

Getting Comments

GET https://ello.co/api/v1/comments?parent_post_id=parent_id_of_the_post

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment