javastrava.api.TokenAPI Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javastrava-api Show documentation
Show all versions of javastrava-api Show documentation
Java implementation of the Strava API
The newest version!
package javastrava.api;
import javastrava.api.async.StravaAPICallback;
import javastrava.auth.TokenService;
import javastrava.auth.model.TokenResponse;
import javastrava.service.exception.UnauthorizedException;
import retrofit.http.Field;
import retrofit.http.FormUrlEncoded;
import retrofit.http.POST;
/**
*
* API implementation of the Strava REST interface for token management
*
*
* @author Dan Shannon
*
*/
public interface TokenAPI {
/**
* @see TokenService#deauthorise(javastrava.auth.model.Token)
*
* @param accessToken
* The access token for which the application is revoking its access.
* @param callback The callback to execute on completion
* @throws UnauthorizedException
* if the token is not allowed to be deauthorised
*/
@FormUrlEncoded
@POST("/oauth/deauthorize")
public void deauthorise(@Field("access_token") final String accessToken, final StravaAPICallback callback) throws UnauthorizedException;
/**
* @see TokenService#deauthorise(javastrava.auth.model.Token)
*
* @param accessToken
* The access token for which the application is revoking its access.
* @return Responds with the access token submitted with the request.
* @throws UnauthorizedException
* if the token is not allowed to be deauthorised
*/
@FormUrlEncoded
@POST("/oauth/deauthorize")
public TokenResponse deauthoriseToken(@Field("access_token") final String accessToken) throws UnauthorizedException;
}