4

I've been working for about 10 hours, and I am completely, 100%, lost. I'm trying to simply query youtube, say for "iPad". Then youtube should return a list of search results... But I'm having all sorts of issues. Here's my code:

     // Create a service object for executing queries
GTLServiceYouTube *service = [[GTLServiceYouTube alloc] init];
// Services which do not require sign-in may need an API key from the
// API Console
service.APIKey = @"AIzaSyD9pvsUtnegJvwv5z5XrBO5vFTBVpErYN8";
// Create a query
GTLQueryYouTube *query = [GTLQueryYouTube queryForSearchListWithPart:@"video"];
query.q = @"hiking boots";
//query.country = @"US";
// Execute the query
GTLServiceTicket *ticket = [service executeQuery:query
                               completionHandler:^(GTLServiceTicket *ticket, id object, NSError *error) {
                                   // This callback block is run when the fetch completes
                                   if (error == nil) {
                                       //I'VE NEVER GOTTEN TO HERE, I ALWAYS GET AN ERROR
                                       }
                                   }else{
                                       NSLog(@"Error: %@", error.description);
                                   }
                               }];

If I do this, I get a the following error:

    Error Domain=com.google.GTLJSONRPCErrorDomain Code=403 "The operation couldn’t be completed. (Access Not Configured)" UserInfo=0x1edab4c0 {error=Access Not Configured, GTLStructuredError=GTLErrorObject 0x1eda3f80: {message:"Access Not Configured" code:403 data:[1]}, NSLocalizedFailureReason=(Access Not Configured)}

What should I do??

1
  • 3
    This code was really useful. I had to use [GTLQueryYouTube queryForSearchListWithPart:@"snippet"] instead of @"video". Nov 9, 2014 at 8:16

2 Answers 2

2

The "Access Not Configured" error is likely because you have not enabled the Youtube Data API in the Google API Console.

You can access that here: https://code.google.com/apis/console

Click on Services and make sure Youtube Data API is turned on.

0
2

There's a known google issue (https://code.google.com/p/gdata-issues/issues/detail?id=5770) that makes it so that even if you have the proper API turned on it will still fail, the bypass is to remove the bundleID from the google console for the project.

1
  • Worked for me! Thanks. Removing all the bundle IDs from the Google console kicked it into "Any application allowed" mode, and it started working. Nov 9, 2014 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.