Permalink
Browse files

Finished off the API definitions, updated readme

  • Loading branch information...
1 parent f5d8645 commit 46c6928e820526fe449bbe645bab227407e23e35 @andzdroid committed Jun 17, 2011
Showing with 86 additions and 10 deletions.
  1. +36 −0 README.md
  2. +50 −10 lib/api.js
View
@@ -20,6 +20,7 @@ Then call the `auth` method to fetch the user's API token.
}
//API token fetched, you can now use all the API methods!
+ //See the tests folder for examples of the library in action!
});
## Methods
@@ -187,3 +188,38 @@ Get a list of likes for a post, or add a new like.
### Like (GET, DELETE)
__Args:__ site ID, post ID, like ID
Get a single like for a post, or delete it.
+
+## Pages
+### Pages (GET, POST)
+__Args:__ site ID
+Get a list of a site's pages, or create a new page.
+
+### Page (GET, PUT, DELETE)
+__Args:__ site ID, page ID
+Get a single page, update it, or delete it.
+
+## Link Categories
+### Categories (GET, POST)
+__Args:__ site ID
+Get a list of categories, or create a new category.
+
+### Category (GET, PUT, DELETE)
+__Args:__ site ID, category ID
+Get a single category, update it, or delete it.
+
+### MoveCategory (PUT)
+__Args:__ site ID, category ID
+Move a category to a new position.
+
+## Links
+### Links (GET, POST)
+__Args:__ site ID, category ID
+Get a list of links, or create a link in the category.
+
+### Link (GET, PUT, DELETE)
+__Args:__ site ID, category ID, link ID
+Get a single link, update it, or delete it.
+
+### MoveLink (PUT)
+__Args:__ site ID, category ID, link ID
+Move a link to a new position.
View
@@ -101,51 +101,91 @@ module.exports = {
'Posts': {
path: 'sites/{0}/posts',
args: 1,
- method: ['GET', 'POST']
+ methods: ['GET', 'POST']
},
'PublicPosts': {
path: 'sites/{0}/posts/public',
args: 1,
- method: ['GET']
+ methods: ['GET']
},
'Post': {
path: 'sites/{0}/posts/{1}',
args: 2,
- method: ['GET', 'PUT', 'DELETE']
+ methods: ['GET', 'PUT', 'DELETE']
},
'PostPhotos': {
path: 'sites/{0}/posts/{1}/photos',
args: 2,
- method: ['GET']
+ methods: ['GET']
},
'PostVideos': {
path: 'sites/{0}/posts/{1}/videos',
args: 2,
- method: ['GET']
+ methods: ['GET']
},
'PostAudioFiles': {
path: 'sites/{0}/posts/{1}/audio_files',
args: 2,
- method: ['GET']
+ methods: ['GET']
},
'Comments': {
path: 'sites/{0}/posts/{1}/comments',
args: 2,
- method: ['GET', 'POST']
+ methods: ['GET', 'POST']
},
'Comment': {
path: 'sites/{0}/posts/{1}/comments/{2}',
args: 3,
- method: ['GET', 'PUT', 'DELETE']
+ methods: ['GET', 'PUT', 'DELETE']
},
'Likes': {
path: 'sites/{0}/posts/{1}/likes',
args: 2,
- method: ['GET', 'POST']
+ methods: ['GET', 'POST']
},
'Like': {
path: 'sites/{0}/posts/{1}/likes/{2}',
args: 3,
- method: ['GET', 'DELETE']
+ methods: ['GET', 'DELETE']
+ },
+ 'Pages': {
+ path: 'sites/{0}/pages',
+ args: 1,
+ methods: ['GET', 'POST']
+ },
+ 'Page': {
+ path: 'sites/{0}/pages/{1}',
+ args: 2,
+ methods: ['GET', 'PUT', 'DELETE']
+ },
+ 'Categories': {
+ path: 'sites/{0}/link_categories',
+ args: 1,
+ methods: ['GET', 'POST']
+ },
+ 'Category': {
+ path: 'sites/{0}/link_categories/{1}',
+ args: 2,
+ methods: ['GET', 'PUT', 'DELETE']
+ },
+ 'MoveCategory': {
+ path: 'sites/{0}/link_categories/{1}/move',
+ args: 2,
+ methods: ['PUT']
+ },
+ 'Links': {
+ path: 'sites/{0}/link_categories/{1}/links',
+ args: 2,
+ methods: ['GET', 'POST']
+ },
+ 'Link': {
+ path: 'sites/{0}/link_categories/{1}/links/{2}',
+ args: 3,
+ methods: ['GET', 'PUT', 'DELETE']
+ },
+ 'MoveLink': {
+ path: 'sites/{0}/link_categories/{1}/links/{2}/move',
+ args: 3,
+ methods: ['PUT']
}
};

0 comments on commit 46c6928

Please sign in to comment.