Changes between Version 4 and Version 5 of Ticket #336


Ignore:
Timestamp:
06/10/10 10:35:15 (4 years ago)
Author:
dread
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #336 – Description

    v4 v5  
    2929This 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? 
    3030 
    31 === Examples === 
     31=== Example search === 
    3232 
    3333POST  
    3434{{{ 
    35 {"url": "scraperwiki.com", "all_fields": 1} 
     35{"url": "scraperwiki.com/", "all_fields": 1} 
    3636}}} 
    3737to: /api/2/search/resource 
     
    3939returns JSON: 
    4040{{{ 
    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",  
    4244   "format": "CSV",  
    4345   "Description": "Scrape of www.lincs.gov/councillors.pdf by ScraperWiki.", 
    44    "hash": "", "package_id": "b8a325c8-af2a-43f3-8245-9db7d73dfbfe" 
     46   "hash": "",  
     47   "position": 2 
    4548 }] 
    4649}}} 
    4750 
    4851Note 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 
     55GET to: /api/2/rest/resource/a3dd8f64-9078-4f04-845c-e3f047125028 
     56 
     57returns: 
     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}}} 
    4968 
    5069=== Search Parameters ===