Using Yahoo's BOSS search API to receive web results for my iPhone app. OAuth errors

121 Views Asked by At

I've searched up and down for a solution, but each one I found do not work and Yahoo's BOSS documentation is awful. It shows you how to send a request to the API but it clearly lacks all of the other required parameters that need to be included to fulfil OAuth.

My app is a search app. I'm using a TableViewController and UISearchBar to populate the table with web search results.

My table cells work fine and the table populates with fake results.

However, BOSS integration is proving to be a headache and I'm unfamiliar with this type of web programming.

- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope
{
    NSString *appid = @"{CONSUMER_KEY}"; // Provided by Yahoo
    NSString *query =  searchText;
    
    NSString *address = @"http://boss.yahooapis.com/ysearch/web/v1/";
    NSString *request = [NSString stringWithFormat:@"%@%@%@%@%@",address, query, @"?appid=", appid, @"&format=xml"];
    
    // TEST URL: http://boss.yahooapis.com/ysearch/web/v1/gfdgfd?appid={CONSUMER_KEY}&format=xml
    
    
    NSURL *URL = [NSURL URLWithString:request];
    NSError *error;
    NSString *XML = [NSString stringWithContentsOfURL:URL encoding:NSASCIIStringEncoding error:&error];
    
    NSLog(@"%@", error);

{CONSUMER_KEY} is the long special key provided by Yahoo upon registering your app to use their service.

I was receiving all kinds of oauth errors but documentation online says that BOSS doesn't use OAuth.

If anyone knows how to set me in the right direction, that'd be fantastic.

0

There are 0 best solutions below