예제 #1
0
  public ApiResponse refreshOAuthAccessToken(String refreshToken) {
    ApiRequest req = new ApiRequest(Office.getApiUrl() + "/passenger/oauth2/token");
    req.addPostParam("refresh_token", refreshToken);
    req.addPostParam("client_id", Office.getOAuthClientId());
    req.addPostParam("client_secret", Office.getOAuthSecret());
    req.addPostParam("grant_type", "refresh_token");

    return doPostRequest(req);
  }
예제 #2
0
  /**
   * [ helpers
   * ]******************************************************************************************
   */
  public ApiResponse getOAuthTokens(String tmpAuthCode) {
    ApiRequest req = new ApiRequest(Office.getApiUrl() + "/passenger/oauth2/token");
    req.addPostParam("code", tmpAuthCode);
    req.addPostParam("client_id", Office.getOAuthClientId());
    req.addPostParam("client_secret", Office.getOAuthSecret());
    req.addPostParam("redirect_url", "");
    req.addPostParam("grant_type", "authorization_code");

    return doPostRequest(req);
  }