API

38 watchers
Aug 2014
2:00pm, 22 Aug 2014
4,377 posts
  •  
  • 0
Badger
Found 10 minutes to play while something else was running, successfully retrieved some threads in Python.
*thumbsup*
Aug 2014
2:11pm, 22 Aug 2014
15,175 posts
  •  
  • 0
flanker
save me the effort thinking about it and post up the script?
Aug 2014
2:13pm, 22 Aug 2014
14,776 posts
  •  
  • 0
fetcheveryone
Excellent :-) Any comments from anyone about the methodology, as viewed from the client-side?

Badger - If you fancy emailing me the python script, I'll add it to the demo folder, to help give other Pythoners a head start.

Generally -

I've just cobbled together a route for creating a thread. It's another step up from just retrieving public data, but I think I've got it working ok. As part of a client request where insert/update/delete (or reading private data etc), the API requires you to supply a user ID. If you're using your own developer key, you're automatically authorised to CRUD in your own name - and the idea is that in time, other people will be able to authorise your app to work on behalf of their user.

I'm not going to share this update just yet, because I think it'd play havoc with the other forum users if we all start creating threads. And secondly, although it's working ok, the word 'cobbled' doesn't please me - I want to go tidy my objects up, and smarten up the way the API responds to errors, before I add too many more methods.

In theory though, it feels like the hard work in terms of getting ready for API users to post training files* :-)

*famous last words.
Aug 2014
2:15pm, 22 Aug 2014
14,777 posts
  •  
  • 0
fetcheveryone
"route for creating a thread" = confusing terminology :-) No routes were run in the making of this API :-)

Perhaps "method for creating a thread" might be better.

I've built the API in such a way that each method defines its required fields in a consistent way - so when we reach critical mass, I should be able to write a script that loops through all the methods and generates something like documentation for all the options.
Aug 2014
2:16pm, 22 Aug 2014
14,778 posts
  •  
  • 0
fetcheveryone
And I think "Pythoners" would be better as "Pythoneers" - it sounds more intrepid :-)
Aug 2014
2:35pm, 22 Aug 2014
87 posts
  •  
  • 0
nuttyficket
fetch, the view from the client side looks very similar to dealing with the strava api (via access tokens, developers keys, other users authorising apps), which is probably a good thing. A familiar model for devs wishing to create apps.
Aug 2014
2:48pm, 22 Aug 2014
14,779 posts
  •  
  • 0
fetcheveryone
Cool. It's all fairly typical from what I've seen across the 'net.
Aug 2014
3:20pm, 22 Aug 2014
14,780 posts
  •  
  • 0
fetcheveryone
I've done a wee bit of tidying - if you do stuff like forget to request the token, you'll still get a well-formed JSON response, with an error message. Similarly, if you try calling a method that doesn't exist, you should get a tidy response in JSON.
Aug 2014
4:28pm, 22 Aug 2014
4,378 posts
  •  
  • 0
Badger
Will send the script as soon as I'm back at a computer, which might be Sunday now (posting from phone on the A14).
Aug 2014
8:32am, 23 Aug 2014
14,782 posts
  •  
  • 0
fetcheveryone
Just uploaded my first ever TCX via the API. #justsaying

About This Thread

Maintained by fetcheveryone
We're very much in the "gently trying things out" stage, but please join in if you're interested in working with a Fetch API:

Get your developer keys here:
http://www.fetcheveryone.com/api-request-keys.php

And a basic PHP client example here:
http://www.fetcheveryone.com/demo/api_client.0.2.zip

With thanks to Badger, here's a Python version:
http://www.fetcheveryone.com/demo/FetchAPIPython_0.2.zip

Available methods:
http://www.fetcheveryone.com/api-doc.php

Join the developer group here:
http://www.fetcheveryone.com/groups-view.php?id=1167

If you'd care to port the client into another language, please let me know, and I can upload it to share with others.

Related Threads

  • api
  • coding
  • import









Back To Top
X

Free training & racing tools for runners, cyclists, swimmers & walkers.

Fetcheveryone lets you analyse your training, find races, plot routes, chat in our forum, get advice, play games - and more! Nothing is behind a paywall, and it'll stay that way thanks to our awesome community!
Get Started
Click here to join 112,237 Fetchies!
Already a Fetchie? Sign in here