| 69 | |
| 70 | ---- |
| 71 | |
| 72 | = Proposed REST API = |
| 73 | |
| 74 | == Resources == |
| 75 | |
| 76 | || '''Resource''' || '''Location''' || |
| 77 | || All Licenses|| !http://ckan.net/api/rest/licenses || |
| 78 | || Licence || !http://ckan.net/api/rest/license/:id || |
| 79 | || All Packages || !http://ckan.net/api/rest/packages || |
| 80 | || Package || !http://ckan.net/api/rest/package/:id || |
| 81 | || All Tags || !http://ckan.net/api/rest/tags || |
| 82 | || Tag || !http://ckan.net/api/rest/tag/:id || |
| 83 | |
| 84 | == Data Formats == |
| 85 | |
| 86 | ==== License List Format ==== |
| 87 | |
| 88 | {{{ |
| 89 | { |
| 90 | "licence-list": [ |
| 91 | { |
| 92 | "id": 1, |
| 93 | 'name": "BSD" |
| 94 | |
| 95 | },{ |
| 96 | "id": 2, |
| 97 | "name": "MIT" |
| 98 | } |
| 99 | ] |
| 100 | } |
| 101 | }}} |
| 102 | |
| 103 | ==== License Format ==== |
| 104 | |
| 105 | {{{ |
| 106 | { |
| 107 | "licence": { |
| 108 | "id": 1, |
| 109 | "name": "BSD" |
| 110 | } |
| 111 | } |
| 112 | }}} |
| 113 | |
| 114 | ==== Package List Format ==== |
| 115 | |
| 116 | {{{ |
| 117 | { |
| 118 | "package-list": [ |
| 119 | { |
| 120 | "id": 1, |
| 121 | "name": "dataset-1" |
| 122 | |
| 123 | },{ |
| 124 | "id": 2, |
| 125 | "name": "dataset-2" |
| 126 | } |
| 127 | ] |
| 128 | } |
| 129 | }}} |
| 130 | |
| 131 | ==== Package Format ==== |
| 132 | |
| 133 | {{{ |
| 134 | { |
| 135 | "package": { |
| 136 | "id": 1, |
| 137 | "name": "string", |
| 138 | "title": "string", |
| 139 | "url": "string", |
| 140 | "download_url": "string", |
| 141 | "licences": [5,7], |
| 142 | "tags": "this that other", |
| 143 | "notes": "some notes" |
| 144 | } |
| 145 | } |
| 146 | }}} |
| 147 | |
| 148 | ==== Tag List Format ==== |
| 149 | |
| 150 | {{{ |
| 151 | { |
| 152 | "tag-list": [ |
| 153 | { |
| 154 | "id": 1, |
| 155 | "name": "this" |
| 156 | |
| 157 | },{ |
| 158 | "id": 2, |
| 159 | "name": "that" |
| 160 | } |
| 161 | ] |
| 162 | } |
| 163 | }}} |
| 164 | |
| 165 | ==== Tag Format ==== |
| 166 | |
| 167 | {{{ |
| 168 | { |
| 169 | "tag": { |
| 170 | "id": 1, |
| 171 | "name": "this" |
| 172 | } |
| 173 | } |
| 174 | }}} |
| 175 | |
| 176 | == Methods and Status Codes == |
| 177 | |
| 178 | || '''Resource''' || '''Method''' || '''Format''' || '''Status Codes''' || |
| 179 | || All Licenses || GET || License List Format || 200, 301 || |
| 180 | || All Licenses || POST || License Format || 201, 400 || |
| 181 | || License || GET || License Format || 200, 301, 410 || |
| 182 | || License || PUT || License Format || 200, 301, 400, 410 || |
| 183 | || License || DELETE || N/A || 200, 204 || |
| 184 | || All Packages || GET || Package List Format || 200, 301 || |
| 185 | || All Packages || POST || Package Format || 201, 400 || |
| 186 | || Package || GET || Package Format || 200, 301, 410 || |
| 187 | || Package || PUT || Package Format || 200, 301, 400, 410 || |
| 188 | || Package || DELETE || N/A || 200, 204 || |
| 189 | || All Tags || GET || Tag List Format || 200, 301 || |
| 190 | || All Tags || POST || Tag Format || 201, 400 || |
| 191 | || Tags || GET || Tag Format || 200, 301, 410 || |
| 192 | || Tags || PUT || Tag Format || 200, 301, 400, 410 || |
| 193 | || Tags || DELETE || N/A || 200, 204 || |
| 194 | |