Ticket #180 (closed enhancement: fixed)

Opened 6 years ago

Last modified 6 years ago

Add JSON views for external services

Reported by: ed Owned by: jim
Priority: major Milestone: Phase 3
Component: Drupal modules & settings Keywords:
Cc: Estimated Number of Hours: 0.0
Add Hours to Ticket: 0 Billable?: yes
Total Hours: 0.9

Description

TN.org needs to be able to communicate with other websites and applications behind the scenes. This could ultimately be to share data with partner sites (e.g. search on Permaculture association returns TT initiatives), but is initially to return requests based on lat/long from the incoming mobile application.

Install and configure so that mobile application can send lat/long requests along with content types (people, projects, initiatives, events) and TN returns location specific responses.

Change History

comment:1 Changed 6 years ago by jim

Services 3 beta 1 is now on LIVE...

comment:2 Changed 6 years ago by jim

  • Status changed from new to accepted

Thinking out loud, the services needed are as follows:

External Sites & Apps (Paul's stuff)

  • Ability for external to pass in a lat/long and 'type' (event, news, person, ini, proj etc) and get back list of node titles, a link to node, last updated date and distance from lat/long.

Sharing Engine - from TN.org

  • Return list of initiatives with location and feeds - ALL to prime system
  • As above but just recent updates to maintain system once primed.

Sharing Engine - to TN.org/other sites

  • ability to receive lat/long and return feed items (RSS feed etc) related to it.

This ties in well with extending TN near me (#182)... Any thoughts, Ed?

Will start adding views & services on DEV now.

comment:3 Changed 6 years ago by ed

Externals may want access to 'latest' (e.g. Patterns - I know Paul's after them too)

'list of initiatives with location and feeds' if you mean being able to return a list of feed items of the initiatives' news related to lat/long which could appear in TN near me, YES PLEASE

comment:4 Changed 6 years ago by jim

  • Add Hours to Ticket changed from 0.0 to 0.15
  • Total Hours changed from 0.0 to 0.15

Web service 'lite' in place for SE stuff...

Additionally, Paul MacKay? wants this for his app:

Inis:

  • name
  • status
  • region
  • initiative type
  • community type
  • approx members
  • main contact
  • website
  • lat/long
  • description
  • themes ?
  • related projects
  • PPoC uid

Projects:

  • title
  • website
  • lat/long
  • description
  • main contact
  • PPoC uid

All in a nice JSON feed.

Prob need two versions of these views:

  • 'all' as a dumb dump to prime the remote cache
  • 'recently updated' which takes a date and shows updates only to update the remote cache.

Patterns yet to be specced...

comment:5 Changed 6 years ago by ed

hang loose on patterns for now - Rob said that there are likely to be changes...

comment:6 Changed 6 years ago by jim

  • Summary changed from Add web services to Add JSON views for external services

Services module NOT being used this time around - overkill for our simple use-cases.

Updating title

comment:7 Changed 6 years ago by jim

  • Add Hours to Ticket changed from 0.0 to 0.5
  • Total Hours changed from 0.15 to 0.65

New JSON view output of initiatives at: http://www.transitionnetwork.org/transition-services/directories/initiatives/all

NOTE this is effectively a data dump and is inefficient. Will speak to Paul to see if adding http://drupal.org/project/views_daterange makes sense so we can pull back, say, all inis updated since the mobile app last checked.

comment:8 Changed 6 years ago by jim

discussion ongoing with Paul MacKay?, projects to follow.

And the ContentTypes? page represents the start of the API/data documentation.

comment:9 Changed 6 years ago by jim

  • Add Hours to Ticket changed from 0.0 to 0.25
  • Status changed from accepted to closed
  • Resolution set to fixed
  • Total Hours changed from 0.65 to 0.9

Projects also have this: http://www.transitionnetwork.org/transition-services/directories/projects/all

And, so clients can get a smaller chunk of data - these two return only those that have been updated within 7 days.

Poss need 'updated within month' version too...

Have now created all required views, will close this until futher request come through.

Note: See TracTickets for help on using tickets.