Class InstagramService
java.lang.Object
com.github.scribejava.core.oauth.OAuthService
com.github.scribejava.core.oauth.OAuth20Service
com.github.scribejava.apis.instagram.InstagramService
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionInstagramService(InstagramApi api, String apiKey, String apiSecret, String callback, String defaultScope, String responseType, OutputStream debugStream, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient) -
Method Summary
Modifier and TypeMethodDescriptionprotected OAuthRequestcreateRefreshTokenRequest(String accessToken, String scope) Refresh a long-lived Instagram User Access Token that is at least 24 hours old but has not expired.getLongLivedAccessToken(OAuth2AccessToken accessToken) Get long-lived access token.getLongLivedAccessToken(OAuth2AccessToken accessToken, OAuthAsyncRequestCallback<OAuth2AccessToken> callback) getLongLivedAccessToken(String shortLivedAccessToken) getLongLivedAccessToken(String shortLivedAccessToken, OAuthAsyncRequestCallback<OAuth2AccessToken> callback) getLongLivedAccessTokenAsync(OAuth2AccessToken accessToken) getLongLivedAccessTokenAsync(String shortLivedAccessToken) Methods inherited from class com.github.scribejava.core.oauth.OAuth20Service
createAccessTokenClientCredentialsGrantRequest, createAccessTokenDeviceAuthorizationGrantRequest, createAccessTokenPasswordGrantRequest, createAccessTokenRequest, createAuthorizationUrlBuilder, createDeviceAuthorizationCodesRequest, createRevokeTokenRequest, extractAuthorization, getAccessToken, getAccessToken, getAccessToken, getAccessToken, getAccessTokenAsync, getAccessTokenAsync, getAccessTokenClientCredentialsGrant, getAccessTokenClientCredentialsGrant, getAccessTokenClientCredentialsGrant, getAccessTokenClientCredentialsGrant, getAccessTokenClientCredentialsGrantAsync, getAccessTokenClientCredentialsGrantAsync, getAccessTokenDeviceAuthorizationGrant, getAccessTokenDeviceAuthorizationGrant, getAccessTokenDeviceAuthorizationGrantAsync, getAccessTokenPasswordGrant, getAccessTokenPasswordGrant, getAccessTokenPasswordGrantAsync, getAccessTokenPasswordGrantAsync, getAccessTokenPasswordGrantAsync, getAccessTokenPasswordGrantAsync, getApi, getAuthorizationUrl, getAuthorizationUrl, getAuthorizationUrl, getAuthorizationUrl, getDefaultScope, getDeviceAuthorizationCodes, getDeviceAuthorizationCodes, getDeviceAuthorizationCodes, getDeviceAuthorizationCodes, getDeviceAuthorizationCodesAsync, getDeviceAuthorizationCodesAsync, getResponseType, getVersion, logRequestWithParams, pollAccessTokenDeviceAuthorizationGrant, refreshAccessToken, refreshAccessToken, refreshAccessToken, refreshAccessToken, refreshAccessTokenAsync, refreshAccessTokenAsync, revokeToken, revokeToken, revokeToken, revokeToken, revokeTokenAsync, revokeTokenAsync, sendAccessTokenRequestAsync, sendAccessTokenRequestAsync, sendAccessTokenRequestSync, signRequest, signRequestMethods inherited from class com.github.scribejava.core.oauth.OAuthService
close, execute, execute, execute, executeAsync, getApiKey, getApiSecret, getCallback, isDebug, log, log
-
Constructor Details
-
InstagramService
public InstagramService(InstagramApi api, String apiKey, String apiSecret, String callback, String defaultScope, String responseType, OutputStream debugStream, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient)
-
-
Method Details
-
createRefreshTokenRequest
Refresh a long-lived Instagram User Access Token that is at least 24 hours old but has not expired. Refreshed tokens are valid for 60 days from the date at which they are refreshed.- Overrides:
createRefreshTokenRequestin classOAuth20Service- Parameters:
accessToken- long-lived access tokenscope- (not used)- Returns:
- refresh token request
-
getLongLivedAccessTokenAsync
-
getLongLivedAccessTokenAsync
-
getLongLivedAccessToken
public Future<OAuth2AccessToken> getLongLivedAccessToken(String shortLivedAccessToken, OAuthAsyncRequestCallback<OAuth2AccessToken> callback) -
getLongLivedAccessToken
public Future<OAuth2AccessToken> getLongLivedAccessToken(OAuth2AccessToken accessToken, OAuthAsyncRequestCallback<OAuth2AccessToken> callback) -
getLongLivedAccessToken
public OAuth2AccessToken getLongLivedAccessToken(OAuth2AccessToken accessToken) throws InterruptedException, ExecutionException, IOException Get long-lived access token. Initial accessToken is valid for 1 hour so one can get long-lived access token. Long-lived access token is valid for 60 days.- Parameters:
accessToken- short-lived access token- Returns:
- long-lived access token with filled expireIn and refreshToken
- Throws:
InterruptedExceptionExecutionExceptionIOException
-
getLongLivedAccessToken
public OAuth2AccessToken getLongLivedAccessToken(String shortLivedAccessToken) throws InterruptedException, ExecutionException, IOException
-