WordCamp-Android icon indicating copy to clipboard operation
WordCamp-Android copied to clipboard

Migrate to v2 endpoints

Open iandunn opened this issue 8 years ago • 4 comments

The V1 endpoints are now deprecated, and will be disabled in 1 year, on 2018-04-01.

Here are the new endpoints:

  • https://central.wordcamp.org/wp-json/wp/v2/wordcamps/
  • https://2016.misc.wordcamp.dev/wp-json/wp/v2/sessions/
  • https://2016.misc.wordcamp.dev/wp-json/wp/v2/speakers/

If you want speakers embedded in session responses, or vice-versa, you can append the ?_embed parameter, and then pull them from the _embedded field. The API handbook has details.

Let me know if you have any questions or run into any problems with the API.

iandunn avatar Mar 30 '17 23:03 iandunn

@aagam-shah, it looks like you might already have this working, but I don't see a PR for it. Is it ready to send a PR, or does it need more work?

iandunn avatar Nov 20 '17 16:11 iandunn

@iandunn - I had started but have left in-between. Will work on it and raise the PR as soon as it's ready

aagam-shah avatar Nov 20 '17 16:11 aagam-shah

The date for disabling the v1 endpoints has passed, though are still active right now.

In relation to #73, I believe that the current query of pulling the last 50 WCs, ordered by ID is flawed, and a slightly different approach is needed when switching to the v2 endpoints.

The v2 endpoint has event start and end date fields:

screenshot 2018-05-15 10 18 12

Each refresh should, over one or more requests, order by the start or end date, and keep retrieving more entries until the end date of an event is earlier than the current date (no point in storing WCs that finished yesterday or earlier).

This will then capture events like WC Europe 2018, which has a low ID (registered early on), but whose start/end date is coming soon.

GaryJones avatar May 15 '18 09:05 GaryJones

#74 appears to be a PR for this issue.

GaryJones avatar May 15 '18 10:05 GaryJones