Changes between Version 4 and Version 5 of Ticket #336
- Timestamp:
- 06/10/10 10:35:15 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #336 – Description
v4 v5 29 29 This is to make our API more general, simple and consistent. It means that the !ScraperWiki client has to do a bit more processing to get exactly what it needs. Is this ok? 30 30 31 === Example s===31 === Example search === 32 32 33 33 POST 34 34 {{{ 35 {"url": "scraperwiki.com ", "all_fields": 1}35 {"url": "scraperwiki.com/", "all_fields": 1} 36 36 }}} 37 37 to: /api/2/search/resource … … 39 39 returns JSON: 40 40 {{{ 41 [{"URL": "http://scraperwiki.com/lincolnshire-councillors", 41 [{"id": "a3dd8f64-9078-4f04-845c-e3f047125028", 42 "package_id": "b8a325c8-af2a-43f3-8245-9db7d73dfbfe", 43 "URL": "http://scraperwiki.com/lincolnshire-councillors", 42 44 "format": "CSV", 43 45 "Description": "Scrape of www.lincs.gov/councillors.pdf by ScraperWiki.", 44 "hash": "", "package_id": "b8a325c8-af2a-43f3-8245-9db7d73dfbfe" 46 "hash": "", 47 "position": 2 45 48 }] 46 49 }}} 47 50 48 51 Note use of package_id instead of package_name is something we're moving towards in the API, since names can change. When we've done ticket:341 then ckan.net/package/lincs-councillors will be a synonym of ckan.net/package/b8a325c8-af2a-43f3-8245-9db7d73dfbfe 52 53 === Example model request === 54 55 GET to: /api/2/rest/resource/a3dd8f64-9078-4f04-845c-e3f047125028 56 57 returns: 58 {{{ 59 [{"id": "a3dd8f64-9078-4f04-845c-e3f047125028", 60 "package_id": "b8a325c8-af2a-43f3-8245-9db7d73dfbfe", 61 "URL": "http://scraperwiki.com/lincolnshire-councillors", 62 "format": "CSV", 63 "Description": "Scrape of www.lincs.gov/councillors.pdf by ScraperWiki.", 64 "hash": "", 65 "position": 2 66 }] 67 }}} 49 68 50 69 === Search Parameters ===