Class InstagramService

java.lang.Object
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable

public class InstagramService
extends OAuth20Service
  • Constructor Details

    • InstagramService

      public InstagramService​(InstagramApi api, java.lang.String apiKey, java.lang.String apiSecret, java.lang.String callback, java.lang.String defaultScope, java.lang.String responseType, java.io.OutputStream debugStream, java.lang.String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient)
  • Method Details

    • createRefreshTokenRequest

      protected OAuthRequest createRefreshTokenRequest​(java.lang.String accessToken, java.lang.String scope)
      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:
      createRefreshTokenRequest in class OAuth20Service
      Parameters:
      accessToken - long-lived access token
      scope - (not used)
      Returns:
      refresh token request
    • getLongLivedAccessTokenAsync

      public java.util.concurrent.Future<OAuth2AccessToken> getLongLivedAccessTokenAsync​(OAuth2AccessToken accessToken)
    • getLongLivedAccessTokenAsync

      public java.util.concurrent.Future<OAuth2AccessToken> getLongLivedAccessTokenAsync​(java.lang.String shortLivedAccessToken)
    • getLongLivedAccessToken

      public java.util.concurrent.Future<OAuth2AccessToken> getLongLivedAccessToken​(java.lang.String shortLivedAccessToken, OAuthAsyncRequestCallback<OAuth2AccessToken> callback)
    • getLongLivedAccessToken

      public java.util.concurrent.Future<OAuth2AccessToken> getLongLivedAccessToken​(OAuth2AccessToken accessToken, OAuthAsyncRequestCallback<OAuth2AccessToken> callback)
    • getLongLivedAccessToken

      public OAuth2AccessToken getLongLivedAccessToken​(OAuth2AccessToken accessToken) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.io.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:
      java.lang.InterruptedException
      java.util.concurrent.ExecutionException
      java.io.IOException
    • getLongLivedAccessToken

      public OAuth2AccessToken getLongLivedAccessToken​(java.lang.String shortLivedAccessToken) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.io.IOException
      Throws:
      java.lang.InterruptedException
      java.util.concurrent.ExecutionException
      java.io.IOException