Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Finished off the API definitions, updated readme

  • Loading branch information...
commit 46c6928e820526fe449bbe645bab227407e23e35 1 parent f5d8645
andzdroid authored June 17, 2011

Showing 2 changed files with 86 additions and 10 deletions. Show diff stats Hide diff stats

  1. 36  README.md
  2. 60  lib/api.js
36  README.md
Source Rendered
@@ -20,6 +20,7 @@ Then call the `auth` method to fetch the user's API token.
20 20
       }
21 21
 
22 22
       //API token fetched, you can now use all the API methods!
  23
+      //See the tests folder for examples of the library in action!
23 24
     });
24 25
 
25 26
 ## Methods
@@ -187,3 +188,38 @@ Get a list of likes for a post, or add a new like.
187 188
 ### Like (GET, DELETE)
188 189
 __Args:__ site ID, post ID, like ID
189 190
 Get a single like for a post, or delete it.
  191
+
  192
+## Pages
  193
+### Pages (GET, POST)
  194
+__Args:__ site ID
  195
+Get a list of a site's pages, or create a new page.
  196
+
  197
+### Page (GET, PUT, DELETE)
  198
+__Args:__ site ID, page ID
  199
+Get a single page, update it, or delete it.
  200
+
  201
+## Link Categories
  202
+### Categories (GET, POST)
  203
+__Args:__ site ID
  204
+Get a list of categories, or create a new category.
  205
+
  206
+### Category (GET, PUT, DELETE)
  207
+__Args:__ site ID, category ID
  208
+Get a single category, update it, or delete it.
  209
+
  210
+### MoveCategory (PUT)
  211
+__Args:__ site ID, category ID
  212
+Move a category to a new position.
  213
+
  214
+## Links
  215
+### Links (GET, POST)
  216
+__Args:__ site ID, category ID
  217
+Get a list of links, or create a link in the category.
  218
+
  219
+### Link (GET, PUT, DELETE)
  220
+__Args:__ site ID, category ID, link ID
  221
+Get a single link, update it, or delete it.
  222
+
  223
+### MoveLink (PUT)
  224
+__Args:__ site ID, category ID, link ID
  225
+Move a link to a new position.
60  lib/api.js
@@ -101,51 +101,91 @@ module.exports = {
101 101
   'Posts': {
102 102
     path: 'sites/{0}/posts',
103 103
     args: 1,
104  
-    method: ['GET', 'POST']
  104
+    methods: ['GET', 'POST']
105 105
   },
106 106
   'PublicPosts': {
107 107
     path: 'sites/{0}/posts/public',
108 108
     args: 1,
109  
-    method: ['GET']
  109
+    methods: ['GET']
110 110
   },
111 111
   'Post': {
112 112
     path: 'sites/{0}/posts/{1}',
113 113
     args: 2,
114  
-    method: ['GET', 'PUT', 'DELETE']
  114
+    methods: ['GET', 'PUT', 'DELETE']
115 115
   },
116 116
   'PostPhotos': {
117 117
     path: 'sites/{0}/posts/{1}/photos',
118 118
     args: 2,
119  
-    method: ['GET']
  119
+    methods: ['GET']
120 120
   },
121 121
   'PostVideos': {
122 122
     path: 'sites/{0}/posts/{1}/videos',
123 123
     args: 2,
124  
-    method: ['GET']
  124
+    methods: ['GET']
125 125
   },
126 126
   'PostAudioFiles': {
127 127
     path: 'sites/{0}/posts/{1}/audio_files',
128 128
     args: 2,
129  
-    method: ['GET']
  129
+    methods: ['GET']
130 130
   },
131 131
   'Comments': {
132 132
     path: 'sites/{0}/posts/{1}/comments',
133 133
     args: 2,
134  
-    method: ['GET', 'POST']
  134
+    methods: ['GET', 'POST']
135 135
   },
136 136
   'Comment': {
137 137
     path: 'sites/{0}/posts/{1}/comments/{2}',
138 138
     args: 3,
139  
-    method: ['GET', 'PUT', 'DELETE']
  139
+    methods: ['GET', 'PUT', 'DELETE']
140 140
   },
141 141
   'Likes': {
142 142
     path: 'sites/{0}/posts/{1}/likes',
143 143
     args: 2,
144  
-    method: ['GET', 'POST']
  144
+    methods: ['GET', 'POST']
145 145
   },
146 146
   'Like': {
147 147
     path: 'sites/{0}/posts/{1}/likes/{2}',
148 148
     args: 3,
149  
-    method: ['GET', 'DELETE']
  149
+    methods: ['GET', 'DELETE']
  150
+  },
  151
+  'Pages': {
  152
+    path: 'sites/{0}/pages',
  153
+    args: 1,
  154
+    methods: ['GET', 'POST']
  155
+  },
  156
+  'Page': {
  157
+    path: 'sites/{0}/pages/{1}',
  158
+    args: 2,
  159
+    methods: ['GET', 'PUT', 'DELETE']
  160
+  },
  161
+  'Categories': {
  162
+    path: 'sites/{0}/link_categories',
  163
+    args: 1,
  164
+    methods: ['GET', 'POST']
  165
+  },
  166
+  'Category': {
  167
+    path: 'sites/{0}/link_categories/{1}',
  168
+    args: 2,
  169
+    methods: ['GET', 'PUT', 'DELETE']
  170
+  },
  171
+  'MoveCategory': {
  172
+    path: 'sites/{0}/link_categories/{1}/move',
  173
+    args: 2,
  174
+    methods: ['PUT']
  175
+  },
  176
+  'Links': {
  177
+    path: 'sites/{0}/link_categories/{1}/links',
  178
+    args: 2,
  179
+    methods: ['GET', 'POST']
  180
+  },
  181
+  'Link': {
  182
+    path: 'sites/{0}/link_categories/{1}/links/{2}',
  183
+    args: 3,
  184
+    methods: ['GET', 'PUT', 'DELETE']
  185
+  },
  186
+  'MoveLink': {
  187
+    path: 'sites/{0}/link_categories/{1}/links/{2}/move',
  188
+    args: 3,
  189
+    methods: ['PUT']
150 190
   }
151 191
 };

0 notes on commit 46c6928

Please sign in to comment.
Something went wrong with that request. Please try again.