| 84 | |
| 85 | |
| 86 | |
| 87 | == Project Directory Service == |
| 88 | |
| 89 | Broadly 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 | |
| 100 | As 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 | |
| 107 | As 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 | }}} |