1

Moving from Nike+ - import questions (Read 116 times)

cindyruns


    I'm moving from a Nike GPS Sportswatch to Garmin, and at the same time trying to figure out if it makes sense to switch to RunningAhead instead of Garmin Connect (from Nike+).

     

    In addition to the standard GPS coordinates, I'd also like to maintain my notes with each run, my shoes used, the weather, etc.

     

    I've experimented a bit with some of the Nike+ export tools available and importing to both RunningAhead and Garmin Connect, and it seems like RunningAhead is much more flexible with what it will import than Garmin Connect.  However, most of the existing tools to create TCX files based on the Nike+ data don't export all of the required information so I'll probably have to do something with their API to create my own export (not a huge deal as I'm already using it to display summary information on my blog).

     

    It seems like I want a combination of the custom CSV import and TCX, as I want to be able to include all of the metadata plus the GPS coordinates (when available).

     

    Any suggestions on how to do this?  Is it possible to include all this information in a TCX file and have it mapped appropriately by RunAhead (shoes used, weather, etc?)

     

    Or is it possible to add GPS coordinates to a run uploaded through a custom CSV file?

     

    Or is there another approach (API?) that would work out better here?  I looked at the API documentation, but didn't see a way to add GPS information to a workout...unless the approach would be to create a new course for each workout?   That doesn't seem to be what happens when I upload a TCX file, though, as I don't have any courses.  Or maybe upload the TCX (or GPX) files and then go back and edit to add in the additional metadata using the API?

     

    Finally, I'd prefer my data to not be locked in...to export, it looks like I would need to do a combination of using the API or exporting each activity as a GPX + the XML in order to have the full dataset?  Is that correct?  There's no way to get a full file with everything in it from RunningAhead?

    eric :)


      Hi cindyruns,

      Since you mentioned the API, the approach you could take is to import the TCX data, then use the RA API to add notes to each workout.  The export function from the website does not export *everything*.  I've been meaning to update it but it will require extensive work due to the potential amount of data that it needs to gather.  It's on my list of things to do.

       

      eric Smile

      cindyruns


        Thanks - I'll give that a try...how do I request the client_id required to use the API?

        cindyruns


          So, I've made a fair amount of progress with this - I imported all the TCX data in to RunningAhead, got familiar with the RunningAhead API, and wrote a script to read the Nike information and map to the appropriate fields in RunningAhead.

           

          When I go to update the imported workouts, though, no matter what I try I get a 400 Bad Request response.

           

          Doc I'm trying to follow:

          https://api.runningahead.com/docs/save_workout

          It doesn't mention any required fields, but the workout object doc mentions Date and ActivityID as required fields, so I've tried updating an existing workout with just those fields:
          https://api.runningahead.com/docs/workout

          Sample request:
          PUT to https://api.runningahead.com/rest/logs/me/workouts/{id}?access_token=<mytoken>
          {"workout":{"date":"2014-06-22","activityID":10}}

          Any idea on what I'm missing? Anyone else have some sample JSON they've used to make updates? As far as I can tell, this looks identical to what comes back in the workout request...

          Thanks!
          eric :)


            Hi Josh,

            If a workout is a run entry, then at least the distance or duration is required.  I'm guessing that's the problem.  Also, the PUT call is for existing workouts, which should not apply to imported workouts.

             

            eric Smile

            cindyruns


              Hi Eric, I'm trying to update existing workouts that I imported from TCX files - i.e., I want to update the weather information, course, notes, etc based on information I already have in Nike+.  The workouts themselves are listed with the appropriate maps, timing duration, etc...I just want to add this information to them.

               

              I am able to get the run id to use in the URL by searching by date - but when I do the put to update it, no matter what fields I try updating I get the 400 error:

              PUT to https://api.runningahead.com/rest/logs/me/workouts/{id}?access_token=<mytoken>

              Are you saying that distance or duration are required in the PUT even if they already exist (though so do ActivityID and date which are also marked as required)?  Or that an imported workout is different from an otherwise already created workout and PUT won't apply?  Is there something else I should be doing to update these imported runs?

              eric :)


                HI Josh,

                To update the workouts, you would first GET each workout object.  You would then add or modify its data and then PUT the entire object back.  The API currently doesn't support partial updates, which is why you need to send the whole thing back.  If that's not the problem, check the response.  Aside from the HTTP response code, which isn't all that helpful, check the actual message sent by the server.  It should have a more specific error code that might point you in the right direction.  If you're still stuck, send me a message.

                 

                eric Smile

                cindyruns


                  Thanks, Eric - I've tried every variation I can think of...sending the whole object unaltered, sending it back without the fields marked as read-only in the API docs, sending just the workout object, sending it as part of a data object, etc.  I always get the 400 error with no other details.

                   

                  I'll follow-up with you directly.

                  cindyruns


                    Looks like there is an error in the documentation in the PUT workout call - Eric clarified for me, and I got it working!