Skip to content

Instantly share code, notes, and snippets.

@booo
Created February 1, 2012 21:47
Show Gist options
  • Select an option

  • Save booo/1719676 to your computer and use it in GitHub Desktop.

Select an option

Save booo/1719676 to your computer and use it in GitHub Desktop.

resource pad

api/:version/pads/

create a pad

POST api/:version/pads/

	{
		'id': 'random pad name/id',
		'text': 'Hello World',
		'revisionCount': Integer,
		'readOnlyId': 'random readonly id'
	}

create a pad with a given id

POST api/:version/pads/:id

	{
		'text': 'Welcome text'
	}
	{
		'id': 'pad name/id',
		'text': 'Hello World',
		'revisionCount': Integer,
		'readOnlyId': 'random readonly id'
	}

create a pad with a given id and an initial text

PUT api/:version/pads/:id

	{
		'text': 'Hello World'
	}
	{
		'id': 'random string',
		'text': 'Hello World',
		'revisionCount': Integer,
		'readOnlyId': 'random readonly id'
	}

maybe this should be a POST request

list pads

GET api/:version/pads

#resource groups api/:version/groups

create a group

POST api/:version/groups

delete a group

DELETE api/:version/groups/:id

list sessions of group

GET api/:versions/groups/:id/sessions/

create a group pad (create a pad for a group) with a given name

POST api/:version/groups/:id/pads/:id

	{
		'text': 'Hello World',
		'public': Boolean,
		'password': 'A secret'
	}
	{
		'id': 'This is the pad id (name)',
		'text': 'Hello World'
		'public': Boolean,
		'password': 'A secret'
	}

get a group pad

GET api/:version/groups/:id/pads/:id

	{
		'id': 'This is the pad id (name)',
		'text': 'Hello World'
		'public': Boolean,
		'password': 'A secret'
	}

get all pads of a group

GET api/:version/groups/:id/pads

	[{
		'id': 'This is the pad id (name)',
		'text': 'Hello World'
		'public': Boolean,
		'password': 'A secret'
	}]

or

	[padId]

delete a session of a group

DELETE api/:version/groups/:id/sessions/:id

get session info

GET api/:version/groups/:id/sessions/:id

	{
		'id': 'id of the created session',
		'authorId': 'id of an existing author',
		'expires': Date //Date object or unix timestamp until this session is valid
	}

create a session for a group and an author

POST api/:version/groups/:id/sessions/

	{
		'authorId': 'id of an existing author',
		'expires': Date //Date object or unix timestamp until this session is valid
	}
	{
		'id': 'id of the created session',
		'authorId': 'id of an existing author',
		'expires': Date //Date object or unix timestamp until this session is valid
	}

#resource authors api/:version/authors

create author

POST api/:version/authors/

	{
		'name': String
	}
	{
		'name': String
		'id': String
	}

list sessions of author

GET api/:version/authors/:id/sessions

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