com.simpleyql
Interface Api

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
ApiImpl

public interface Api
extends java.io.Serializable

Allows applications to authorize Yahoo users and make API calls in behalf of them.

Authorizations are done by redirecting the user to Yahoo's page.

Author:
chester

Method Summary
 void askAuthorization(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String finalUrl)
          Redirects the current user to the authorization page.
 QueryResult query(java.lang.String yql, java.lang.String token)
          Sends a YQL request to Yahoo
 

Method Detail

askAuthorization

void askAuthorization(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response,
                      java.lang.String finalUrl)
                      throws java.io.IOException,
                             OAuthException
Redirects the current user to the authorization page.

It will store OAuth bookkeeping information at the request's session.

At the end of the process, the user will be redirected to finalURL, which will recieve the "token" parameter by GET (which should be stored for future use).

Throws:
java.io.IOException
OAuthException

query

QueryResult query(java.lang.String yql,
                  java.lang.String token)
                  throws OAuthException,
                         java.io.IOException
Sends a YQL request to Yahoo

Parameters:
yql - Request formatted as YQL.
token -
Returns:
Response from the API
Throws:
java.io.IOException
OAuthException


Copyright © 2009. All Rights Reserved.