You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* We set 'object\_type to "activity" and "aspect\_type" to "create" for you.
300
-
*`strava.pushSubscriptions.delete({id:...},done)`
295
+
*`strava.pushSubscriptions.delete({id:...},done)`
301
296
302
-
Running Races:
297
+
#### Running Races
303
298
304
-
*`strava.runningRaces.get(args,done)`
305
-
*`strava.runningRaces.listRaces(args,done)`
299
+
*`strava.runningRaces.get(args,done)`
300
+
*`strava.runningRaces.listRaces(args,done)`
306
301
307
-
Routes:
302
+
#### Routes
308
303
309
-
*`strava.routes.get(args,done)`
310
304
311
-
Segments:
305
+
*`strava.routes.get(args,done)`
312
306
313
-
*`strava.segments.get(args,done)`
314
-
*`strava.segments.listStarred(args,done)`
315
-
*`strava.segments.listEfforts(args,done)`
316
-
*`strava.segments.listLeaderboard(args,done)`
317
-
*`strava.segments.explore(args,done)`
307
+
#### Segments
318
308
319
-
Segment Efforts:
309
+
*`strava.segments.get(args,done)`
310
+
*`strava.segments.listStarred(args,done)`
311
+
*`strava.segments.listEfforts(args,done)`
312
+
*`strava.segments.listLeaderboard(args,done)`
313
+
*`strava.segments.explore(args,done)`
320
314
321
-
*`strava.segmentEfforts.get(args,done)`
315
+
#### Segment Efforts
322
316
323
-
Streams:
317
+
*`strava.segmentEfforts.get(args,done)`
324
318
325
-
*`strava.streams.activity(args,done)`
326
-
*`strava.streams.effort(args,done)`
327
-
*`strava.streams.segment(args,done)`
319
+
#### Streams
328
320
329
-
Uploads:
321
+
*`strava.streams.activity(args,done)`
322
+
*`strava.streams.effort(args,done)`
323
+
*`strava.streams.segment(args,done)`
330
324
331
-
*`strava.uploads.post(args,done)`
325
+
#### Uploads
332
326
327
+
*`strava.uploads.post(args,done)`
333
328
334
329
## Error Handling
335
330
@@ -339,7 +334,8 @@ Promise-based API, the promise will be rejected. An error of type
339
334
`RequestError` will be returned if the request fails for technical reasons.
340
335
Example error checking:
341
336
342
-
var errors = require('request-promise/errors')
337
+
```javascript
338
+
consterrors=require('request-promise/errors')
343
339
344
340
// Catch a non-2xx response with the Promise API
345
341
badClient.athlete.get({})
@@ -349,7 +345,7 @@ Example error checking:
349
345
badClient.athlete.get({},function(err,payload){
350
346
// err will be instanceof errors.StatusCodeError
351
347
}
352
-
348
+
```
353
349
354
350
## Development
355
351
@@ -358,20 +354,20 @@ It will both lint and run shallow tests on API endpoints.
358
354
359
355
### Running the tests
360
356
361
-
You'll first need to supply `data/strava_config` with an `access_token` that has both private read and write permissions:
357
+
You'll first need to supply `data/strava_config` with an `access_token` that
358
+
has both private read and write permissions. Look in `./scripts` for a tool
359
+
to help generate this token. Going forward we plan to more testing with a mocked
360
+
version of the Strava API so testing with real account credentials are not required.
362
361
363
362
* Make sure you've filled out all the fields in `data/strava_config`.
364
363
* Use `strava.oauth.getRequestAccessURL({scope:"view_private,write"})` to generate the request url and query it via your browser.
365
364
* Strava will prompt you (the user) to allow access, say yes and you'll be sent to your Authorization Redirection URI - the parameter `code` will be included in the redirection url.
0 commit comments