| 1 | = Web Data Services = |
| 2 | |
| 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]. |
| 4 | |
| 5 | == Directory Services == |
| 6 | |
| 7 | These services provide lists of core ContentTypes that can be used to prime or update remote caches and clients. |
| 8 | |
| 9 | |
| 10 | === Initiative Directory Service === |
| 11 | |
| 12 | Returns a list of initiatives with their basic data and geographical coordinate information. See below for an example |
| 13 | |
| 14 | ==== ALL initiatives ==== |
| 15 | * '''Returns:''' All initiatives in in the directory - see below for format and example output. |
| 16 | * '''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. |
| 17 | * '''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 | |
| 20 | |
| 21 | ==== Initiatives updated within 30 days ==== |
| 22 | |
| 23 | As above except: |
| 24 | * '''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. |
| 25 | * '''Service URL''': http://www.transitionnetwork.org/transition-services/directories/initiatives/updated-month |
| 26 | |
| 27 | |
| 28 | ==== Initiatives updated within 7 days ==== |
| 29 | |
| 30 | As above except: |
| 31 | * '''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. |
| 32 | * '''Service URL''': http://www.transitionnetwork.org/transition-services/directories/initiatives/updated-week |
| 33 | |
| 34 | |
| 35 | ==== Returned fields & sample output ==== |
| 36 | '''Fields:''' See ContentTypes for a full description of the fields |
| 37 | * nid - node id |
| 38 | * url - directory page on Transition Network.org |
| 39 | * title |
| 40 | * initiative_community_types - multi-select option values |
| 41 | * initiative_type - single-select option value |
| 42 | * initiative_status - single-select option value |
| 43 | * initiative_members_count_estimated - formatted number |
| 44 | * websites - usually one, potentially several URLs representing the initiative |
| 45 | * contact_primary_name - formatted string |
| 46 | * contact_primary_uid - user ID to be used to pull up contact pages on TN.org (thus maintaining privacy) |
| 47 | * location_city, location_province_name, location_country_name - strings for the address |
| 48 | * location_latitude, location_longitude - decimal coordinates representing geocoded position of imitative |
| 49 | |
| 50 | '''Example output:''' |
| 51 | {{{ |
| 52 | { |
| 53 | "initiatives" : [ |
| 54 | { |
| 55 | "initiative" : { |
| 56 | "nid" : "23", |
| 57 | "url" : "https://www.transitionnetwork.org/initiatives/totnes", |
| 58 | "title" : "Totnes", |
| 59 | "updated" : "2011-01-21T06:54:20+0000", |
| 60 | "initiative_community_types" : { |
| 61 | "1" : "Town", |
| 62 | "2" : "Rural" |
| 63 | }, |
| 64 | "initiative_type" : "Local Initiative", |
| 65 | "initiative_status" : "Official", |
| 66 | "initiative_members_count_estimated" : "3,300", |
| 67 | "websites" : "http://totnes.transitionnetwork.org", |
| 68 | "contact_primary_name" : "Lou Brown", |
| 69 | "contact_primary_uid" : "3516", |
| 70 | "location_city" : "Totnes", |
| 71 | "location_province_name" : "Devon", |
| 72 | "location_country_name" : "United Kingdom", |
| 73 | "location_latitude" : "50.431213", |
| 74 | "location_longitude" : "-3.685455" |
| 75 | } |
| 76 | }, |
| 77 | [... repeats ...] |
| 78 | ] |
| 79 | } |
| 80 | }}} |
| 81 | |