public class API extends Object
Provides a static method instance(Class, Token) which constructs a standard retrofit service with all the required options.
| Constructor and Description |
|---|
API(Token token)
Construct an API instance with a given token
|
public API(Token token)
token - The access token to be used with calls to the APIpublic static AuthorisationAPI authorisationInstance()
Get an instance of the authorisation API (cached)
public static <T> T instance(Class<T> class1, Token token)
Creates and returns a new API RestAdapter instance.
T - Class of API interface to be instantiated (one of the *API.java interfaces)class1 - The class to be returnedtoken - The access token required for authentication of requests to the Strava APIpublic static retrofit.RestAdapter.LogLevel logLevel(Class<?> class1)
class1 - Class for which log level is to be determinedpublic StravaUploadResponse checkUploadStatus(Integer uploadId)
uploadId - The upload id as given back in the response to upload(StravaActivityType, String, String, Boolean, Boolean, Boolean, String, String, TypedFile)UploadAPI.checkUploadStatus(java.lang.Integer)public StravaAPIFuture<StravaUploadResponse> checkUploadStatusAsync(Integer uploadId)
uploadId - The upload id as given back in the response to upload(StravaActivityType, String, String, Boolean, Boolean, Boolean, String, String, TypedFile)CompletableFuture on which to call future.complete() when the API returnsUploadAPI.checkUploadStatus(java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaComment createComment(Integer activityId, String text) throws BadRequestException, NotFoundException
activityId - Activity identifiertext - Text of the comment to createNotFoundException - If the activity does not existBadRequestException - If the comment text is null or the empty stringActivityAPI.createComment(java.lang.Integer, java.lang.String)public StravaAPIFuture<StravaComment> createCommentAsync(Integer activityId, String text) throws BadRequestException, NotFoundException
activityId - Activity identifiertext - Text of the comment to createCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the activity does not existBadRequestException - If the comment text is null or the empty stringpublic StravaActivity createManualActivity(StravaActivity activity) throws BadRequestException
Create a manual activity
activity - Activity to create on StravaBadRequestException - If the request is invalid in some wayActivityAPI.createManualActivity(javastrava.api.v3.model.StravaActivity)public StravaAPIFuture<StravaActivity> createManualActivityAsync(StravaActivity activity) throws BadRequestException
activity - The activity to be created on StravaCompletableFuture on which to call future.complete() when the API returnsBadRequestException - If the activity is malformed and can't be uploadedActivityAPI.createManualActivity(javastrava.api.v3.model.StravaActivity, javastrava.api.v3.rest.async.StravaAPICallback)public StravaEventSubscription createSubscription(Integer clientId, String clientSecret, StravaSubscriptionObjectType objectType, StravaSubscriptionAspectType aspectType, String callbackURL, String verifyToken)
clientId - Application's id, as obtained during registration with StravaclientSecret - Application's secret, as obtained during Strava registrationobjectType - The type of object being subscribed toaspectType - The aspect being subscribed tocallbackURL - (Max 255 characters) URL which Strava will callback with an HTTP GET to verify the existence of the webhook endpoint, then subsequently will POST to with subscribed eventsverifyToken - The token's value will be included in the GET callback request when verifying the endpointpublic StravaAPIFuture<StravaEventSubscription> createSubscriptionAsync(Integer clientId, String clientSecret, StravaSubscriptionObjectType objectType, StravaSubscriptionAspectType aspectType, String callbackURL, String verifyToken)
clientId - Application's id, as obtained during registration with StravaclientSecret - Application's secret, as obtained during Strava registrationobjectType - The type of object being subscribed toaspectType - The aspect being subscribed tocallbackURL - (Max 255 characters) URL which Strava will callback with an HTTP GET to verify the existence of the webhook endpoint, then subsequently will POST to with subscribed eventsverifyToken - The token's value will be included in the GET callback request when verifying the endpointpublic TokenResponse deauthoriseToken(String accessToken) throws UnauthorizedException
accessToken - The access token for which the application is revoking its access.UnauthorizedException - if the token is not allowed to be deauthorisedTokenAPI.deauthoriseToken(java.lang.String)public StravaAPIFuture<TokenResponse> deauthoriseTokenAsync(String accessToken) throws UnauthorizedException
accessToken - The access token for which the application is revoking its access.CompletableFuture on which to call future.complete() when the API returnsUnauthorizedException - if the token is not allowed to be deauthorisedTokenAPI.deauthorise(java.lang.String, javastrava.api.v3.rest.async.StravaAPICallback)public StravaActivity deleteActivity(Integer id) throws NotFoundException
Delete an activity on Strava
id - Activity identifierNotFoundException - If the identified activity does not existActivityAPI.deleteActivity(java.lang.Integer)public StravaAPIFuture<StravaActivity> deleteActivityAsync(Integer activityId) throws NotFoundException
Delete an activity on Strava
activityId - Activity identifierCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the identified activity does not existActivityAPI.deleteActivity(java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaResponse deleteComment(Integer activityId, Integer commentId) throws NotFoundException
activityId - Id of the activity the comment was posted tocommentId - Id of the commentNotFoundException - If the comment does not existActivityAPI.deleteComment(java.lang.Integer, java.lang.Integer)public StravaAPIFuture<StravaResponse> deleteCommentAsync(Integer activityId, Integer commentId) throws NotFoundException
activityId - Id of the activity the comment was posted tocommentId - Id of the commentCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the comment does not existActivityAPI.deleteComment(java.lang.Integer, java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaResponse deleteSubscription(Integer subscriptionId, Integer clientId, String clientSecret)
subscriptionId - The id of the subscription to be deletedclientId - Application's id, as obtained during registration with StravaclientSecret - Application's secret, as obtained during Strava registrationWebhookAPI.deleteSubscription(java.lang.Integer, java.lang.Integer, java.lang.String)public StravaAPIFuture<StravaResponse> deleteSubscriptionAsync(Integer subscriptionId, Integer clientId, String clientSecret)
subscriptionId - The id of the subscription to be deletedclientId - Application's id, as obtained during registration with StravaclientSecret - Application's secret, as obtained during Strava registrationWebhookAPI.deleteSubscription(java.lang.Integer, java.lang.Integer, java.lang.String)public StravaActivity getActivity(Integer id, Boolean includeAllEfforts) throws NotFoundException
Get details of an activity
id - Activity identifierincludeAllEfforts - Whether or not to include only efforts that Strava considers 'important'NotFoundException - If the activity does not existActivityAPI.getActivity(java.lang.Integer, java.lang.Boolean)public StravaAPIFuture<StravaActivity> getActivityAsync(Integer id, Boolean includeAllEfforts) throws NotFoundException
Get details of an activity
id - Activity identifierincludeAllEfforts - Whether or not to include only efforts that Strava considers 'important'CompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the activity does not existActivityAPI.getActivity(java.lang.Integer, java.lang.Boolean, javastrava.api.v3.rest.async.StravaAPICallback)public StravaStream[] getActivityStreams(Integer activityId, String types, StravaStreamResolutionType resolution, StravaStreamSeriesDownsamplingType seriesType) throws UnauthorizedException, NotFoundException, BadRequestException
activityId - The id of the activity for which streams are to be retrievedtypes - List of types, if the activity does not have that stream it will not be included in the responseresolution - (Optional) low (100), medium (1000) or high (10000), default is all, indicates desired number of data points,
streams will only be down sampledseriesType - (Optional) relevant only if using resolution. Either "time" or "distance", default is "distance", used to index
the streams if the stream is being reducednull if the activity doesn't existUnauthorizedException - If there is a security exceptionNotFoundException - If the activity does not existBadRequestException - If the request is malformedStreamAPI.getActivityStreams(java.lang.Integer, java.lang.String,
javastrava.api.v3.model.reference.StravaStreamResolutionType, javastrava.api.v3.model.reference.StravaStreamSeriesDownsamplingType)public StravaAPIFuture<StravaStream[]> getActivityStreamsAsync(Integer activityId, String types, StravaStreamResolutionType resolution, StravaStreamSeriesDownsamplingType seriesType) throws UnauthorizedException, NotFoundException, BadRequestException
activityId - The id of the activity for which streams are to be retrievedtypes - List of types, if the activity does not have that stream it will not be included in the responseresolution - (Optional) low (100), medium (1000) or high (10000), default is all, indicates desired number of data points,
streams will only be down sampledseriesType - (Optional) relevant only if using resolution. Either "time" or "distance", default is "distance", used to index
the streams if the stream is being reducedCompletableFuture on which to call future.complete() when the API returnsUnauthorizedException - If there is a security exceptionNotFoundException - If the activity does not existBadRequestException - If the request is malformedStreamAPI.getActivityStreams(java.lang.Integer, java.lang.String, javastrava.api.v3.model.reference.StravaStreamResolutionType, javastrava.api.v3.model.reference.StravaStreamSeriesDownsamplingType, javastrava.api.v3.rest.async.StravaAPICallback)public StravaAthlete getAthlete(Integer athleteId) throws NotFoundException
athleteId - Athlete identifierNotFoundException - If the athlete doesn't existAthleteAPI.getAthlete(java.lang.Integer)public StravaAPIFuture<StravaAthlete> getAthleteAsync(Integer athleteId) throws NotFoundException
athleteId - Athlete identifierCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the athlete doesn't existAthleteAPI.getAthlete(java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaAthlete getAuthenticatedAthlete()
AthleteAPI.getAuthenticatedAthlete()public StravaAPIFuture<StravaAthlete> getAuthenticatedAthleteAsync()
CompletableFuture on which to call future.complete() when the API returnsAthleteAPI.getAuthenticatedAthlete(javastrava.api.v3.rest.async.StravaAPICallback)public StravaClub getClub(Integer clubId) throws NotFoundException
clubId - Club identifierNotFoundException - If the club with the given id doesn't existClubAPI.getClub(java.lang.Integer)public StravaAPIFuture<StravaClub> getClubAsync(Integer clubId) throws NotFoundException
clubId - Club identifierCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the club with the given id doesn't existClubAPI.getClub(java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaStream[] getEffortStreams(Long segmentEffortId, String types, StravaStreamResolutionType resolution, StravaStreamSeriesDownsamplingType seriesType) throws UnauthorizedException, NotFoundException, BadRequestException
segmentEffortId - The id of the segment effort for which streams are to be retrievedtypes - List of types, if the effort does not have that stream it will not be included in the responseresolution - (Optional) low (100), medium (1000) or high (10000), default is all, indicates desired number of data points,
streams will only be down sampledseriesType - (Optional) relevant only if using resolution. Either "time" or "distance", default is "distance", used to index
the streams if the stream is being reducedUnauthorizedException - If the security token is not valid or the effort is flagged as privateNotFoundException - If the effort does not existBadRequestException - If the request is malformedStreamAPI.getEffortStreams(java.lang.Long, java.lang.String, javastrava.api.v3.model.reference.StravaStreamResolutionType,
javastrava.api.v3.model.reference.StravaStreamSeriesDownsamplingType)public StravaAPIFuture<StravaStream[]> getEffortStreamsAsync(Long segmentEffortId, String types, StravaStreamResolutionType resolution, StravaStreamSeriesDownsamplingType seriesType) throws UnauthorizedException, NotFoundException, BadRequestException
segmentEffortId - The id of the segment effort for which streams are to be retrievedtypes - List of types, if the effort does not have that stream it will not be included in the responseresolution - (Optional) low (100), medium (1000) or high (10000), default is all, indicates desired number of data points,
streams will only be down sampledseriesType - (Optional) relevant only if using resolution. Either "time" or "distance", default is "distance", used to index
the streams if the stream is being reducedCompletableFuture on which to call future.complete() when the API returnsUnauthorizedException - If the security token is not valid or the effort is flagged as privateNotFoundException - If the effort does not existBadRequestException - If the request is malformedStreamAPI.getEffortStreams(java.lang.Long, java.lang.String, javastrava.api.v3.model.reference.StravaStreamResolutionType, javastrava.api.v3.model.reference.StravaStreamSeriesDownsamplingType, javastrava.api.v3.rest.async.StravaAPICallback)public StravaGear getGear(String gearId) throws NotFoundException
gearId - Gear identifierNotFoundException - If the gear with the given id doesn't existGearAPI.getGear(java.lang.String)public StravaAPIFuture<StravaGear> getGearAsync(String gearId) throws NotFoundException
gearId - Gear identifierCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the gear with the given id doesn't existGearAPI.getGear(java.lang.String, javastrava.api.v3.rest.async.StravaAPICallback)public StravaSegment getSegment(Integer segmentId) throws NotFoundException
segmentId - The unique identifier of the segmentNotFoundException - If the segment with the given id does not existSegmentAPI.getSegment(java.lang.Integer)public StravaAPIFuture<StravaSegment> getSegmentAsync(Integer segmentId) throws NotFoundException
segmentId - The unique identifier of the segmentCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the segment with the given id does not existSegmentAPI.getSegment(java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaSegmentEffort getSegmentEffort(Long segmentEffortId) throws NotFoundException
segmentEffortId - Effort identifierNotFoundException - If the effort with the given id doesn't existSegmentEffortAPI.getSegmentEffort(java.lang.Long)public StravaAPIFuture<StravaSegmentEffort> getSegmentEffortAsync(Long segmentEffortId) throws NotFoundException
segmentEffortId - Effort identifierCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the effort with the given id doesn't existSegmentEffortAPI.getSegmentEffort(java.lang.Long, javastrava.api.v3.rest.async.StravaAPICallback)public StravaSegmentLeaderboard getSegmentLeaderboard(Integer segmentId, StravaGender gender, StravaAgeGroup ageGroup, StravaWeightClass weightClass, Boolean following, Integer clubId, StravaLeaderboardDateRange dateRange, Integer page, Integer perPage, Integer contextEntries) throws NotFoundException, BadRequestException
segmentId - Segment identifiergender - (Optional) Gender to filter the leaderboard byageGroup - (Optional) Age group to filter the leaderboard byweightClass - (Optional) Weight class to filter the leaderboard byfollowing - (Optional) If true then filter leaderboard by athletes the authenticated athlete is followingclubId - (Optional) Club to filter the leaderboard bydateRange - (Optional) Date range (this year, this month etc.) to filter the leaderboard bypage - (Optional) Page number to return (default is 1)perPage - (Optional) Page size to return (default is 50)contextEntries - (Optional) Number of context entries to return either side of the authenticated athlete (default is 2, maximum is 15)NotFoundException - If the segment with the given id doesn't existBadRequestException - If the paging instructions are invalidSegmentAPI.getSegmentLeaderboard(java.lang.Integer, javastrava.api.v3.model.reference.StravaGender,
javastrava.api.v3.model.reference.StravaAgeGroup, javastrava.api.v3.model.reference.StravaWeightClass, java.lang.Boolean, java.lang.Integer,
javastrava.api.v3.model.reference.StravaLeaderboardDateRange, java.lang.Integer, java.lang.Integer, java.lang.Integer)public StravaAPIFuture<StravaSegmentLeaderboard> getSegmentLeaderboardAsync(Integer segmentId, StravaGender gender, StravaAgeGroup ageGroup, StravaWeightClass weightClass, Boolean following, Integer clubId, StravaLeaderboardDateRange dateRange, Integer page, Integer perPage, Integer contextEntries) throws NotFoundException, BadRequestException
segmentId - Segment identifiergender - (Optional) Gender to filter the leaderboard byageGroup - (Optional) Age group to filter the leaderboard byweightClass - (Optional) Weight class to filter the leaderboard byfollowing - (Optional) If true then filter leaderboard by athletes the authenticated athlete is followingclubId - (Optional) Club to filter the leaderboard bydateRange - (Optional) Date range (this year, this month etc.) to filter the leaderboard bypage - (Optional) Page number to return (default is 1)perPage - (Optional) Page size to return (default is 50)contextEntries - (Optional) Number of context entries to return either side of the authenticated athlete (default is 2, maximum is 15)CompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the segment with the given id doesn't existBadRequestException - If the paging instructions are invalidSegmentAPI.getSegmentLeaderboard(java.lang.Integer, javastrava.api.v3.model.reference.StravaGender, javastrava.api.v3.model.reference.StravaAgeGroup, javastrava.api.v3.model.reference.StravaWeightClass, java.lang.Boolean, java.lang.Integer, javastrava.api.v3.model.reference.StravaLeaderboardDateRange, java.lang.Integer, java.lang.Integer, java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaStream[] getSegmentStreams(Integer segmentId, String types, StravaStreamResolutionType resolution, StravaStreamSeriesDownsamplingType seriesType) throws UnauthorizedException, NotFoundException, BadRequestException
segmentId - The id of the segment for which streams are to be retrievedtypes - List of types, if the segment does not have that stream it will not be included in the responseresolution - (Optional) low (100), medium (1000) or high (10000), default is all, indicates desired number of data points,
streams will only be down sampledseriesType - (Optional) relevant only if using resolution. Either "time" or "distance", default is "distance", used to index
the streams if the stream is being reducedUnauthorizedException - If there is a security exceptionNotFoundException - If the segment does not existBadRequestException - If the request is malformedStreamAPI.getSegmentStreams(java.lang.Integer, java.lang.String,
javastrava.api.v3.model.reference.StravaStreamResolutionType, javastrava.api.v3.model.reference.StravaStreamSeriesDownsamplingType)public StravaAPIFuture<StravaStream[]> getSegmentStreamsAsync(Integer segmentId, String types, StravaStreamResolutionType resolution, StravaStreamSeriesDownsamplingType seriesType) throws UnauthorizedException, NotFoundException, BadRequestException
segmentId - The id of the segment for which streams are to be retrievedtypes - List of types, if the segment does not have that stream it will not be included in the responseresolution - (Optional) low (100), medium (1000) or high (10000), default is all, indicates desired number of data points,
streams will only be down sampledseriesType - (Optional) relevant only if using resolution. Either "time" or "distance", default is "distance", used to index
the streams if the stream is being reducedCompletableFuture on which to call future.complete() when the API returnsUnauthorizedException - If there is a security exceptionNotFoundException - If the segment does not existBadRequestException - If the request is malformedStreamAPI.getSegmentStreams(java.lang.Integer, java.lang.String, javastrava.api.v3.model.reference.StravaStreamResolutionType, javastrava.api.v3.model.reference.StravaStreamSeriesDownsamplingType, javastrava.api.v3.rest.async.StravaAPICallback)public StravaResponse giveKudos(Integer activityId) throws NotFoundException
activityId - Activity to be kudoedNotFoundException - if the activity does not existActivityAPI.giveKudos(java.lang.Integer)public StravaAPIFuture<StravaResponse> giveKudosAsync(Integer activityId) throws NotFoundException
activityId - Activity to be kudoedCompletableFuture on which to call future.complete() when the API returnsNotFoundException - if the activity does not existActivityAPI.giveKudos(java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaClubMembershipResponse joinClub(Integer clubId) throws NotFoundException
clubId - The club the authenticated athlete wishes to joinNotFoundException - If the club with the given id doesn't existClubAPI.joinClub(java.lang.Integer)public StravaAPIFuture<StravaClubMembershipResponse> joinClubAsync(Integer clubId) throws NotFoundException
clubId - The club the authenticated athlete wishes to joinCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the club with the given id doesn't existClubAPI.joinClub(Integer, StravaAPICallback)public StravaClubMembershipResponse leaveClub(Integer clubId) throws NotFoundException
clubId - The club the authenticated athlete wishes to leaveNotFoundException - If the club with the given id doesn't existClubAPI.leaveClub(java.lang.Integer)public StravaAPIFuture<StravaClubMembershipResponse> leaveClubAsync(Integer clubId) throws NotFoundException
clubId - The club the authenticated athlete wishes to leaveCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the club with the given id doesn't existClubAPI.leaveClub(Integer, StravaAPICallback)public StravaComment[] listActivityComments(Integer activityId, Boolean markdown, Integer page, Integer perPage) throws NotFoundException, BadRequestException
activityId - Activity identifiermarkdown - Whether or not to return comments including markdownpage - Page number to be returnedperPage - Page size to be returnedNotFoundException - If the activity doesn't existBadRequestException - If the paging instructions are invalidActivityAPI.listActivityComments(java.lang.Integer, java.lang.Boolean, java.lang.Integer, java.lang.Integer)public StravaAPIFuture<StravaComment[]> listActivityCommentsAsync(Integer activityId, Boolean markdown, Integer page, Integer perPage) throws NotFoundException, BadRequestException
activityId - Activity identifiermarkdown - Whether or not to return comments including markdownpage - Page number to be returnedperPage - Page size to be returnedCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the activity doesn't existBadRequestException - If the paging instructions are invalidActivityAPI.listActivityComments(java.lang.Integer, java.lang.Boolean, java.lang.Integer, java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaAthlete[] listActivityKudoers(Integer activityId, Integer page, Integer perPage) throws NotFoundException, BadRequestException
activityId - Activity identifierpage - Page number to be returnedperPage - Page size to be returnedNotFoundException - If the activity doesn't existBadRequestException - If the paging instructions are invalidActivityAPI.listActivityKudoers(java.lang.Integer, java.lang.Integer, java.lang.Integer)public StravaAPIFuture<StravaAthlete[]> listActivityKudoersAsync(Integer activityId, Integer page, Integer perPage) throws NotFoundException, BadRequestException
activityId - Activity identifierpage - Page number to be returnedperPage - Page size to be returnedCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the activity doesn't existBadRequestException - If the paging instructions are invalidActivityAPI.listActivityKudoers(Integer, Integer, Integer, StravaAPICallback)public StravaLap[] listActivityLaps(Integer activityId) throws NotFoundException
activityId - The activity identifierNotFoundException - If the activity doesn't existActivityAPI.listActivityLaps(java.lang.Integer)public StravaAPIFuture<StravaLap[]> listActivityLapsAsync(Integer activityId) throws NotFoundException
activityId - The activity identifierCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the activity doesn't existBadRequestException - If the paging instructions are invalidActivityAPI.listActivityLaps(Integer, StravaAPICallback)public StravaPhoto[] listActivityPhotos(Integer activityId) throws NotFoundException
activityId - Activity identifierNotFoundException - If the activity doesn't existActivityAPI.listActivityPhotos(java.lang.Integer)public StravaAPIFuture<StravaPhoto[]> listActivityPhotosAsync(Integer activityId) throws NotFoundException
activityId - Activity identifierCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the activity doesn't existActivityAPI.listActivityPhotos(java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaActivityZone[] listActivityZones(Integer activityId) throws NotFoundException
activityId - The activity identifierNotFoundException - If the activity doesn't existActivityAPI.listActivityZones(java.lang.Integer)public StravaAPIFuture<StravaActivityZone[]> listActivityZonesAsync(Integer activityId) throws NotFoundException
activityId - The activity identifierCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the activity doesn't existActivityAPI.listActivityZones(java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaAthlete[] listAthleteFriends(Integer athleteId, Integer page, Integer perPage) throws NotFoundException, BadRequestException
athleteId - Athlete identifierpage - Page number to be returned (default is 1)perPage - Page size to be returned (default is 50)NotFoundException - If the athlete with the given id doesn't existBadRequestException - If the paging instructions are invalidAthleteAPI.listAthleteFriends(java.lang.Integer, java.lang.Integer, java.lang.Integer)public StravaAPIFuture<StravaAthlete[]> listAthleteFriendsAsync(Integer athleteId, Integer page, Integer perPage) throws NotFoundException, BadRequestException
athleteId - Athlete identifierpage - Page number to be returned (default is 1)perPage - Page size to be returned (default is 50)CompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the athlete with the given id doesn't existBadRequestException - If the paging instructions are invalidAthleteAPI.listAthleteFriends(java.lang.Integer, java.lang.Integer, java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaSegmentEffort[] listAthleteKOMs(Integer athleteId, Integer page, Integer perPage) throws NotFoundException, BadRequestException
athleteId - Athlete identifierpage - Page number to be returned (default is 1)perPage - Page size to be returned (default is 50)NotFoundException - If the athlete doesn't existBadRequestException - If the paging instructions are invalidAthleteAPI.listAthleteKOMs(java.lang.Integer, java.lang.Integer, java.lang.Integer)public StravaAPIFuture<StravaSegmentEffort[]> listAthleteKOMsAsync(Integer athleteId, Integer page, Integer perPage) throws NotFoundException, BadRequestException
athleteId - Athlete identifierpage - Page number to be returned (default is 1)perPage - Page size to be returned (default is 50)CompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the athlete doesn't existBadRequestException - If the paging instructions are invalidAthleteAPI.listAthleteKOMs(java.lang.Integer, java.lang.Integer, java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaAthlete[] listAthletesBothFollowing(Integer athleteId, Integer page, Integer perPage) throws NotFoundException, BadRequestException
athleteId - Athlete identifierpage - Page number to be returned (default is 1)perPage - Page size to be returned (default is 50)NotFoundException - If the athlete with the given id doesn't existBadRequestException - If the paging instructions are invalidAthleteAPI.listAthletesBothFollowing(java.lang.Integer, java.lang.Integer, java.lang.Integer)public StravaAPIFuture<StravaAthlete[]> listAthletesBothFollowingAsync(Integer athleteId, Integer page, Integer perPage) throws NotFoundException, BadRequestException
athleteId - Athlete identifierpage - Page number to be returned (default is 1)perPage - Page size to be returned (default is 50)CompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the athlete with the given id doesn't existBadRequestException - If the paging instructions are invalidAthleteAPI.listAthletesBothFollowing(java.lang.Integer, java.lang.Integer, java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaActivity[] listAuthenticatedAthleteActivities(Integer before, Integer after, Integer page, Integer perPage) throws BadRequestException
before - Time in milliseconds since the UNIX epoch date - only return activities commenced before this timeafter - Time in milliseconds since the UNIX epoch date - only return activities commenced after this timepage - Page number to returnperPage - Number of results to returnBadRequestException - If the paging instructions are invalidActivityAPI.listAuthenticatedAthleteActivities(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer)public StravaAPIFuture<StravaActivity[]> listAuthenticatedAthleteActivitiesAsync(Integer before, Integer after, Integer page, Integer perPage) throws BadRequestException
before - Time in milliseconds since the UNIX epoch date - only return activities commenced before this timeafter - Time in milliseconds since the UNIX epoch date - only return activities commenced after this timepage - Page number to returnperPage - Number of results to returnCompletableFuture on which to call future.complete() when the API returnsBadRequestException - If the paging instructions are invalidActivityAPI.listAuthenticatedAthleteActivities(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaClub[] listAuthenticatedAthleteClubs()
ClubAPI.listAuthenticatedAthleteClubs()public StravaAPIFuture<StravaClub[]> listAuthenticatedAthleteClubsAsync()
CompletableFuture on which to call future.complete() when the API returnsClubAPI.listAuthenticatedAthleteClubs(javastrava.api.v3.rest.async.StravaAPICallback)public StravaAthlete[] listAuthenticatedAthleteFriends(Integer page, Integer perPage) throws BadRequestException
page - Page number to be returned (default is 1)perPage - Page size to be returned (default is 50)BadRequestException - If the paging instructions are invalidAthleteAPI.listAuthenticatedAthleteFriends(java.lang.Integer, java.lang.Integer)public StravaAPIFuture<StravaAthlete[]> listAuthenticatedAthleteFriendsAsync(Integer page, Integer perPage) throws BadRequestException
page - Page number to be returned (default is 1)perPage - Page size to be returned (default is 50)CompletableFuture on which to call future.complete() when the API returnsBadRequestException - If the paging instructions are invalidAthleteAPI.listAuthenticatedAthleteFriends(java.lang.Integer, java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaSegment[] listAuthenticatedAthleteStarredSegments(Integer page, Integer perPage) throws BadRequestException
page - (optional) Page number to be returnedperPage - (optional) Number of entries to return per pageBadRequestException - If the paging instructions are invalidSegmentAPI.listAuthenticatedAthleteStarredSegments(java.lang.Integer, java.lang.Integer)public StravaAPIFuture<StravaSegment[]> listAuthenticatedAthleteStarredSegmentsAsync(Integer page, Integer perPage) throws BadRequestException
page - (optional) Page number to be returnedperPage - (optional) Number of entries to return per pageCompletableFuture on which to call future.complete() when the API returnsBadRequestException - If the paging instructions are invalidSegmentAPI.listAuthenticatedAthleteStarredSegments(java.lang.Integer, java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaClubAnnouncement[] listClubAnnouncements(Integer clubId) throws NotFoundException
clubId - The club id for which announcements should be returnedStravaClubAnnouncement for the given clubNotFoundException - If the club with the given id does not existClubAPI.listClubAnnouncements(Integer)public StravaAPIFuture<StravaClubAnnouncement[]> listClubAnnouncementsAsync(Integer clubId) throws NotFoundException
clubId - The club id for which announcements should be returnedCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the club with the given id does not existClubAPI.listClubAnnouncements(java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaClubEvent[] listClubGroupEvents(Integer clubId)
clubId - Unique id of the club whose events should be listedpublic StravaAPIFuture<StravaClubEvent[]> listClubGroupEventsAsync(Integer clubId)
clubId - Unique id of the club whose events should be listedCompletableFuture on which to call future.complete() when the API call returns.public StravaAthlete[] listClubMembers(Integer clubId, Integer page, Integer perPage) throws NotFoundException, BadRequestException
clubId - CLub identifierpage - Page number to be returned (default is 1)perPage - Page size to be returned (default is 50)NotFoundException - If the club with the given id doesn't existBadRequestException - If the paging instructions are invalidClubAPI.listClubMembers(java.lang.Integer, java.lang.Integer, java.lang.Integer)public StravaAPIFuture<StravaAthlete[]> listClubMembersAsync(Integer clubId, Integer page, Integer perPage) throws NotFoundException, BadRequestException
clubId - CLub identifierpage - Page number to be returned (default is 1)perPage - Page size to be returned (default is 50)CompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the club with the given id doesn't existBadRequestException - If the paging instructions are invalidClubAPI.listClubMembers(java.lang.Integer, java.lang.Integer, java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaActivity[] listFriendsActivities(Integer page, Integer perPage) throws BadRequestException
page - Page number to be returnedperPage - Page size to be returnedBadRequestException - If the paging instructions are invalidActivityAPI.listFriendsActivities(java.lang.Integer, java.lang.Integer)public StravaAPIFuture<StravaActivity[]> listFriendsActivitiesAsync(Integer page, Integer perPage) throws BadRequestException
page - Page number to be returnedperPage - Page size to be returnedCompletableFuture on which to call future.complete() when the API returnsBadRequestException - If the paging instructions are invalidActivityAPI.listFriendsActivities(Integer, Integer, StravaAPICallback)public StravaActivity[] listRecentClubActivities(Integer clubId, Integer page, Integer perPage) throws NotFoundException, BadRequestException
clubId - Club identifierpage - Page number to be returned (default is 1)perPage - Page size to be returned (default is 50)NotFoundException - If the club with the given id doesn't existBadRequestException - If the paging instructions are invalidClubAPI.listRecentClubActivities(java.lang.Integer, java.lang.Integer, java.lang.Integer)public StravaAPIFuture<StravaActivity[]> listRecentClubActivitiesAsync(Integer clubId, Integer page, Integer perPage) throws NotFoundException, BadRequestException
clubId - Club identifierpage - Page number to be returned (default is 1)perPage - Page size to be returned (default is 50)CompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the club with the given id doesn't existBadRequestException - If the paging instructions are invalidClubAPI.listRecentClubActivities(java.lang.Integer, java.lang.Integer, java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaActivity[] listRelatedActivities(Integer activityId, Integer page, Integer perPage) throws NotFoundException, BadRequestException
activityId - Activity identifierpage - Page number to be returnedperPage - Page size to be returnedNotFoundException - If the activity doesn't existBadRequestException - If the paging instructions are invalidActivityAPI.listRelatedActivities(java.lang.Integer, java.lang.Integer, java.lang.Integer)public StravaAPIFuture<StravaActivity[]> listRelatedActivitiesAsync(Integer activityId, Integer page, Integer perPage) throws NotFoundException, BadRequestException
activityId - Activity identifierpage - Page number to be returnedperPage - Page size to be returnedCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the activity doesn't existBadRequestException - If the paging instructions are invalidActivityAPI.listRelatedActivities(java.lang.Integer, java.lang.Integer, java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaSegmentEffort[] listSegmentEfforts(Integer segmentId, Integer athleteId, String start, String end, Integer page, Integer perPage) throws NotFoundException, BadRequestException
segmentId - The id of the StravaSegment for which segment efforts are to be returnedathleteId - (Optional) id of the StravaAthlete to filter results bystart - (Optional) ISO 8601 formatted date timeend - (Optional) ISO 8601 formatted date timepage - (optional) Page number to be returnedperPage - (optional) Number of entries to return per pagesegment effort summary representations sorted by start_date_local
ascending or by elapsed_time if an athlete_id is provided.NotFoundException - If the segment with the given id doesn't existBadRequestException - If the paging instructions are invalidSegmentAPI.listSegmentEfforts(java.lang.Integer, java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer,
java.lang.Integer)public StravaAPIFuture<StravaSegmentEffort[]> listSegmentEffortsAsync(Integer segmentId, Integer athleteId, String start, String end, Integer page, Integer perPage) throws NotFoundException, BadRequestException
segmentId - The id of the StravaSegment for which segment efforts are to be returnedathleteId - (Optional) id of the StravaAthlete to filter results bystart - (Optional) ISO 8601 formatted date timeend - (Optional) ISO 8601 formatted date timepage - (optional) Page number to be returnedperPage - (optional) Number of entries to return per pageCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the segment with the given id doesn't existBadRequestException - If the paging instructions are invalidSegmentAPI.listSegmentEfforts(java.lang.Integer, java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer, java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaSegment[] listStarredSegments(Integer athleteId, Integer page, Integer perPage) throws NotFoundException, BadRequestException
athleteId - The id of the athlete whose starred segments are to be retrievedpage - (optional) Page number to be returnedperPage - (optional) Number of entries to return per pageNotFoundException - If the segment with the given id does not existUnauthorizedException - If there is a security or privacy violationBadRequestException - If the paging instructions are invalidpublic StravaAPIFuture<StravaSegment[]> listStarredSegmentsAsync(Integer athleteId, Integer page, Integer perPage) throws NotFoundException, BadRequestException
athleteId - The id of the athlete whose starred segments are to be retrievedpage - (optional) Page number to be returnedperPage - (optional) Number of entries to return per pageCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the segment with the given id does not existUnauthorizedException - If there is a security or privacy violationBadRequestException - If the paging instructions are invalidSegmentAPI.listStarredSegments(java.lang.Integer, java.lang.Integer, java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaEventSubscription[] listSubscriptions(Integer clientId, String clientSecret)
clientId - Application's id, as obtained during registration with StravaclientSecret - Application's secret, as obtained during Strava registrationWebhookAPI.listSubscriptions(java.lang.Integer, java.lang.String)public StravaAPIFuture<StravaEventSubscription[]> listSubscriptionsAsync(Integer clientId, String clientSecret)
clientId - Application's id, as obtained during registration with StravaclientSecret - Application's secret, as obtained during Strava registrationWebhookAPI.listSubscriptions(java.lang.Integer, java.lang.String)public StravaSegmentExplorerResponse segmentExplore(String bounds, StravaSegmentExplorerActivityType activityType, StravaClimbCategory minCategory, StravaClimbCategory maxCategory)
bounds - Pair of co-ordinates defining a box which is to be searched for segmentsactivityType - (Optional) Activity type to filter by (default is 'ride')minCategory - (Optional) Minimum climb category for which rides should be returnedmaxCategory - (Optional) Maximum climb category for which rides should be returnedSegmentAPI.segmentExplore(java.lang.String, javastrava.api.v3.model.reference.StravaSegmentExplorerActivityType,
javastrava.api.v3.model.reference.StravaClimbCategory, javastrava.api.v3.model.reference.StravaClimbCategory)public StravaAPIFuture<StravaSegmentExplorerResponse> segmentExploreAsync(String bounds, StravaSegmentExplorerActivityType activityType, StravaClimbCategory minCategory, StravaClimbCategory maxCategory)
bounds - Pair of co-ordinates defining a box which is to be searched for segmentsactivityType - (Optional) Activity type to filter by (default is 'ride')minCategory - (Optional) Minimum climb category for which rides should be returnedmaxCategory - (Optional) Maximum climb category for which rides should be returnedCompletableFuture on which to call future.complete() when the API returnsSegmentAPI.segmentExplore(java.lang.String, javastrava.api.v3.model.reference.StravaSegmentExplorerActivityType, javastrava.api.v3.model.reference.StravaClimbCategory, javastrava.api.v3.model.reference.StravaClimbCategory, javastrava.api.v3.rest.async.StravaAPICallback)public StravaStatistics statistics(Integer athleteId) throws NotFoundException
athleteId - Athlete identifierNotFoundException - If the identified athlete doesn't existAthleteAPI.statistics(java.lang.Integer)public StravaAPIFuture<StravaStatistics> statisticsAsync(Integer athleteId) throws NotFoundException
athleteId - Athlete identifierCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the identified athlete doesn't existAthleteAPI.statistics(java.lang.Integer, javastrava.api.v3.rest.async.StravaAPICallback)public StravaActivity updateActivity(Integer id, StravaActivityUpdate activity) throws NotFoundException
Update an activity that already exists on Strava
id - Activity identifieractivity - Update representationNotFoundException - If the activity with the given id does not existActivityAPI.updateActivity(java.lang.Integer, javastrava.api.v3.model.StravaActivityUpdate)public StravaAPIFuture<StravaActivity> updateActivityAsync(Integer id, StravaActivityUpdate activity) throws NotFoundException
Update an activity that already exists on Strava
id - Activity identifieractivity - Update representationCompletableFuture on which to call future.complete() when the API returnsNotFoundException - If the activity with the given id does not existActivityAPI.updateActivity(java.lang.Integer, javastrava.api.v3.model.StravaActivityUpdate, javastrava.api.v3.rest.async.StravaAPICallback)public StravaAthlete updateAuthenticatedAthlete(String city, String state, String country, StravaGender sex, Float weight)
city - City the athlete is fromstate - State/county/territory/canton/departement/whatever the athlete is fromcountry - Country the athlete is fromsex - Gender of the athleteweight - Weight in kilogramsAthleteAPI.updateAuthenticatedAthlete(java.lang.String, java.lang.String, java.lang.String,
javastrava.api.v3.model.reference.StravaGender, java.lang.Float)public StravaAPIFuture<StravaAthlete> updateAuthenticatedAthleteAsync(String city, String state, String country, StravaGender sex, Float weight)
city - City the athlete is fromstate - State/county/territory/canton/departement/whatever the athlete is fromcountry - Country the athlete is fromsex - Gender of the athleteweight - Weight in kilogramsCompletableFuture on which to call future.complete() when the API returnsAthleteAPI.updateAuthenticatedAthlete(java.lang.String, java.lang.String, java.lang.String, javastrava.api.v3.model.reference.StravaGender, java.lang.Float, javastrava.api.v3.rest.async.StravaAPICallback)public StravaUploadResponse upload(StravaActivityType activityType, String name, String description, Boolean _private, Boolean trainer, Boolean commute, String dataType, String externalId, retrofit.mime.TypedFile file) throws BadRequestException
activityType - Type of activity being uploadedname - Name of the activitydescription - (Optional) Description of the activity_private - (Optional) Whether the activity should be flagged as privatetrainer - (Optional) If true then the activity was done on a stationary trainercommute - (Optional) If true then the activity was a commutedataType - Type of data file being uploadedexternalId - (Optional) External identifier generated by your application which Strava will later use as a reference when you're checking upload statusfile - The file to be uploaded!BadRequestException - If required elements of the call are missingUploadAPI.upload(javastrava.api.v3.model.reference.StravaActivityType, java.lang.String, java.lang.String, java.lang.Boolean, java.lang.Boolean,
java.lang.Boolean, java.lang.String, java.lang.String, retrofit.mime.TypedFile)public StravaAPIFuture<StravaUploadResponse> uploadAsync(StravaActivityType activityType, String name, String description, Boolean _private, Boolean trainer, Boolean commute, String dataType, String externalId, retrofit.mime.TypedFile file) throws BadRequestException
activityType - Type of activity being uploadedname - Name of the activitydescription - (Optional) Description of the activity_private - (Optional) Whether the activity should be flagged as privatetrainer - (Optional) If true then the activity was done on a stationary trainercommute - (Optional) If true then the activity was a commutedataType - Type of data file being uploadedexternalId - (Optional) External identifier generated by your application which Strava will later use as a reference when you're checking upload statusfile - The file to be uploaded!CompletableFuture on which to call future.complete() when the API returnsBadRequestException - If required elements of the call are missingUploadAPI.upload(javastrava.api.v3.model.reference.StravaActivityType, java.lang.String, java.lang.String, java.lang.Boolean, java.lang.Boolean, java.lang.Boolean, java.lang.String, java.lang.String, retrofit.mime.TypedFile, javastrava.api.v3.rest.async.StravaAPICallback)public StravaAthlete[] listClubAdmins(Integer clubId, Integer page, Integer perPage)
@GET(value="/athlete/zones") public StravaAthleteZones getAuthenticatedAthleteZones()
@GET(value="/athlete/zones") public StravaAPIFuture<StravaAthleteZones> getAuthenticatedAthleteZonesAsync()
Copyright © 2016 Dan Shannon. All rights reserved.