Changes between Version 1 and Version 2 of WebServices


Ignore:
Timestamp:
01/26/11 12:48:08 (6 years ago)
Author:
jim
Comment:

added projects, tidied

Legend:

Unmodified
Added
Removed
Modified
  • WebServices

    v1 v2  
    1 = Web Data Services = 
     1[[PageOutline(2-5, Table of Contents, floated)]] 
     2= Web Services = 
    23 
    3 This page describes the web services and data provided by the main [http://www.transitionnetwork.org/ Transition Network] website and the [http://news.transitionnetwork.org/ Sharing Engine]. 
     4This page describes the web services and data provided by the main [http://www.transitionnetwork.org/ Transition Network] website and the [http://news.transitionnetwork.org/ Sharing Engine]. They include 
    45 
    5 == Directory Services == 
    6  
    7 These services provide lists of core ContentTypes that can be used to prime or update remote caches and clients.  
     6'''Directory Services:''' Return directories of ContentTypes that can be used to prime or update remote caches and clients.  
     7'''News Services:''' Return news stories for a given location, radius and type. 
    88 
    99 
    10 === Initiative Directory Service === 
     10 
     11== Initiative Directory Service == 
    1112 
    1213Returns a list of initiatives with their basic data and geographical coordinate information. See below for an example 
     
    1617 * '''Usage:''' To be used sparingly to prime remote cache of initiative data. Use 7 or 30 day update versions for refreshes. This view is cached for 6 hours to reduce performance impacts on the main site. 
    1718 * '''Service URL''': http://www.transitionnetwork.org/transition-services/directories/initiatives/all 
    18  * '''Parameters:''' None, only three variations of this view exist - 'all' and updated within 7 or 30 days versions. 
     19 * '''Parameters:''' None, only three variations of this view exist - 'all' and updated within 7 or 30 days versions. The last segment of the URL changes for accordingly. 
    1920 
    2021 
     
    3334 
    3435 
    35 ==== Returned fields & sample output ==== 
     36=== Returned fields & sample output === 
    3637'''Fields:''' See ContentTypes for a full description of the fields 
    3738 * nid - node id 
    3839 * url - directory page on Transition Network.org 
    3940 * title 
     41 * updated - timestamp in [http://www.w3.org/TR/NOTE-datetime W3C DTF] 
    4042 * initiative_community_types - multi-select option values 
    4143 * initiative_type - single-select option value 
     
    8082}}} 
    8183 
     84 
     85 
     86 
     87== Project Directory Service == 
     88 
     89Broadly similar to the Initiative Directory Service, except returning Project data. See ContentTypes for a proper description of this. 
     90 
     91==== ALL Projects ==== 
     92 * '''Returns:''' All projects in in the directory - see below for format and example output. 
     93 * '''Usage:''' To be used sparingly to prime remote cache of project data. Use 7 or 30 day update versions for refreshes. This view is cached for 6 hours to reduce performance impacts on the main site. 
     94 * '''Service URL''': http://www.transitionnetwork.org/transition-services/directories/projects/all 
     95 * '''Parameters:''' None, only three variations of this view exist - 'all' and updated within 7 or 30 days versions. The last segment of the URL changes for accordingly. 
     96 
     97 
     98==== Projects updated within 30 days ==== 
     99 
     100As above except: 
     101 * '''Usage:''' To be used whenever a client needs to refresh their cache, unless the time since last update less than 7 days in which case use the version below, or more that 30 days in which case get ALL again. View cached for 6 hours. 
     102 * '''Service URL''': http://www.transitionnetwork.org/transition-services/directories/projects/updated-month 
     103 
     104 
     105==== Projects updated within 7 days ==== 
     106 
     107As above except: 
     108 * '''Usage:''' To be used whenever a client needs to refresh their cache, unless the time since last update is more that 7 days in which case use month variant. View cached for 1 hour. 
     109 * '''Service URL''': http://www.transitionnetwork.org/transition-services/directories/projects/updated-week 
     110 
     111 
     112==== Returned fields & sample output ==== 
     113'''Fields:''' See ContentTypes for a full description of the fields 
     114 * nid - node id 
     115 * url - directory page on Transition Network.org 
     116 * title 
     117 * updated - timestamp in [http://www.w3.org/TR/NOTE-datetime W3C DTF] 
     118 * project_start_date - date formatted for display (DD MMM YYYY) 
     119 * project_people_involved - formatted number 
     120 * websites - usually one, potentially several URLs representing the initiative  
     121 * contact_primary_name - formatted string 
     122 * contact_primary_uid - user ID to be used to pull up contact pages on TN.org (thus maintaining privacy) 
     123 * location_city, location_province_name, location_country_name - strings for the address 
     124 * location_latitude, location_longitude - decimal coordinates representing geocoded position of imitative 
     125 
     126'''Example output:''' 
     127{{{ 
     128{ 
     129  "projects" : [ 
     130    { 
     131      "project" : { 
     132        "nid" : "14779", 
     133        "url" : "https://www.transitionnetwork.org/projects/newport-fruit-vegie-swap", 
     134        "title" : "Newport Fruit & Vegie Swap", 
     135        "updated" : "2011-01-24T12:41:14+0000", 
     136        "project_start_date" : "14 Aug 2010", 
     137        "project_people_involved" : "4", 
     138        "websites" : "http://www.facebook.com/pages/Newport-fruit-and-vegie-swap/144892595545635?v=wal...", 
     139        "contact_primary_name" : "Kate Leslie", 
     140        "contact_primary_uid" : "3129", 
     141        "location_city" : "Newport", 
     142        "location_province_name" : "Victoria", 
     143        "location_country_name" : "Australia", 
     144        "location_latitude" : "-37.841581", 
     145        "location_longitude" : "144.874088" 
     146      } 
     147    } 
     148    [... repeats ...] 
     149  ] 
     150} 
     151}}}